魏超 hace 5 años
padre
commit
a1b51a4de3

+ 5
- 5
src/pages/activity/groupActivity/editGroupActivity.jsx Ver fichero

@@ -159,7 +159,7 @@ const Edit = props => {
159 159
     if (groupActivityId) {
160 160
       console.log(groupActivityId, 'groupActivityId')
161 161
       useEffect(() => {
162
-        request({ ...apis.activity.poster, params: { targetId: groupActivityId, targetType: 'activity' } }).then((data) => {
162
+        request({ ...apis.activity.poster, params: { targetId: groupActivityId, targetType: 'groupActivity' } }).then((data) => {
163 163
           console.log(data, "2222")
164 164
           if (data.length > 0) {
165 165
             setPosterId(data[0].posterId)
@@ -193,7 +193,7 @@ const Edit = props => {
193 193
             message.info(err.msg || err.message)
194 194
           })
195 195
         } else {
196
-          request({ ...apis.activity.addPoster, data: { targetId: groupActivityId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
196
+          request({ ...apis.activity.addPoster, data: { targetId: groupActivityId, targetType: 'groupActivity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
197 197
             setPosterId(data.posterId)
198 198
             message.info("保存成功")
199 199
           }).catch((err) => {
@@ -274,7 +274,7 @@ const Edit = props => {
274 274
 
275 275
     if (groupActivityId) {
276 276
       useEffect(() => {
277
-        request({ ...apis.activity.shareContent, params: { targetId: groupActivityId, targetType: 'activity' }, }).then((data) => {
277
+        request({ ...apis.activity.shareContent, params: { targetId: groupActivityId, targetType: 'groupActivity' }, }).then((data) => {
278 278
           console.log(data, "2222")
279 279
           if (data.length > 0) {
280 280
             setShareContentId(data[0].shareContentId)
@@ -290,13 +290,13 @@ const Edit = props => {
290 290
     const submitShare = () => {
291 291
       if (groupActivityId) {
292 292
         if (shareContentId) {
293
-          request({ ...apis.activity.updateShareContent, urlData: { id: shareContentId }, data: { targetId: groupActivityId, shareContentType: 'activity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
293
+          request({ ...apis.activity.updateShareContent, urlData: { id: shareContentId }, data: { targetId: groupActivityId, shareContentType: 'groupActivity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
294 294
             message.info("保存成功")
295 295
           }).catch((err) => {
296 296
             message.info(err.msg || err.message)
297 297
           })
298 298
         } else {
299
-          request({ ...apis.activity.addShareContent, data: { targetId: groupActivityId, shareContentType: 'activity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
299
+          request({ ...apis.activity.addShareContent, data: { targetId: groupActivityId, shareContentType: 'groupActivity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
300 300
             setShareContentId(data.shareContentId)
301 301
             message.info("保存成功")
302 302
           }).catch((err) => {

+ 27
- 26
src/pages/activity/groupActivity/helpRecord.jsx Ver fichero

@@ -1,5 +1,5 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Radio, Modal, Descriptions } from 'antd';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Radio, Modal, Descriptions, message} from 'antd';
3 3
 import moment from 'moment';
4 4
 import request from '../../../utils/request';
5 5
 import apis from '../../../services/apis';
@@ -142,22 +142,20 @@ class Verifier extends React.Component {
142 142
   constructor(props) {
143 143
     super(props);
144 144
     this.state = {
145
-      helpRecordInitiateId: { id: '' },
146
-      visibleData: { visible: false, customerId: '', realtyConsultant: '', helpRecordInitiateId: '' },
145
+      groupActivityId: { id: '' },
146
+      visibleData: { visible: false, groupActivityId: '' },
147 147
     }
148 148
   }
149 149
 
150 150
   // 挂载之后
151 151
   componentDidMount () {
152
-    const { customerId } = this.state.visibleData
153
-    this.getList({ helpRecordInitiateId: customerId, pageNumber: 1, pageSize: 5 })
152
+    const { groupActivityId } = this.state.visibleData
154 153
   }
155 154
 
156 155
   componentDidUpdate (preProps, preState) {
157
-    const { customerId } = this.state.visibleData
156
+    const { groupActivityId } = this.state.visibleData
158 157
     console.log('this.state.visibleData', this.state.visibleData)
159
-    if (this.props.visibleData.customerId !== preState.visibleData.customerId) {
160
-      this.getList({ helpRecordInitiateId: customerId, pageNumber: 1, pageSize: 5 })
158
+    if (this.props.visibleData.visible !== preState.visibleData.visible) {
161 159
       this.setState({ visibleData: this.props.visibleData });
162 160
     }
163 161
   }
@@ -171,13 +169,14 @@ class Verifier extends React.Component {
171 169
   // 弹框取消按钮
172 170
   handleCancel () {
173 171
     // this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
174
-    this.props.onCancel();
172
+    // this.props.onCancel();
173
+    this.props.onSuccess({groupActivityId: this.props.visibleData.groupActivityId, groupStatus: 0});
175 174
   }
176 175
 
177
-  getList (params) {
178
-    request({ ...apis.groupActivity.shareSuccList, params: { ...params } }).then(res => {
179
-        console.log(res);
180
-      this.setState({ dataSource: res })
176
+   getVerCodeList (params) {
177
+    request({ ...apis.groupActivity.verification, params: { ...params } }).then(res => {
178
+      // eslint-disable-next-line no-undef
179
+      message.info('核销成功')
181 180
     }).catch(err => {
182 181
       // eslint-disable-next-line no-unused-expressions
183 182
       <Alert
@@ -193,13 +192,13 @@ class Verifier extends React.Component {
193 192
 
194 193
   // eslint-disable-next-line class-methods-use-this
195 194
   verify(e) {
196
-    console.log('111', e.target.value)
195
+    this.setState({ visibleData: { visible: true, groupActivityId: this.props.visibleData.groupActivityId, verificationCode: e.target.value } })
197 196
   }
198 197
 
199 198
   // eslint-disable-next-line class-methods-use-this
200 199
   verification(e) {
201
-    console.log('this.state.visibleData', this.state.visibleData)
202
-      alert(1)
200
+    this.getVerCodeList({ groupActivityId: this.state.visibleData.groupActivityId, verifyCode: this.state.visibleData.verificationCode })
201
+    this.props.onSuccess({groupActivityId: this.props.visibleData.groupActivityId, groupStatus: 0});
203 202
   }
204 203
 
205 204
   render () {
@@ -232,7 +231,7 @@ class Verifier extends React.Component {
232 231
 function body(props) {
233 232
   const [gInviteData, setGInviteData] = useState({ visible: false, groupActivityId : '', recordId:'',  groupStatus: ''})
234 233
 
235
-  const [gVerifierData, setVerifierData] = useState({ visible: false, groupActivityId: '', groupStatus: '' })
234
+  const [gVerifierData, setVerifierData] = useState({ visible: false, groupActivityId: '', verificateCode: '' })
236 235
 
237 236
   const { getFieldDecorator, getFieldsValue } = props.form
238 237
 
@@ -332,10 +331,8 @@ function body(props) {
332 331
     const { value } = e.target
333 332
     setgroupStatus(value)
334 333
     if (value == 0) { 
335
-        console.log("success", value)
336 334
         getList({ pageNumber: 1, pageSize: 10, groupStatus: value, groupActivityId: groupActivityId }) }
337 335
     if (value == 1 || value == 2) {
338
-        console.log("faile", value)
339 336
          getFailList({ pageNumber: 1, pageSize: 10, groupStatus: value, groupActivityId: groupActivityId })
340 337
          }
341 338
   }
@@ -380,18 +377,22 @@ function body(props) {
380 377
 function helpRecord(row) {
381 378
 // 关闭核销
382 379
 // eslint-disable-next-line max-len
383
-  setVerifierData({ visible: false, helpRecordInitiateId: row.helpRecordInitiateId})
380
+  setVerifierData({ visible: false, groupActivityId: row.groupActivityId,  groupStatus: 0})
384 381
   // eslint-disable-next-line max-len
385
-  console.log("tttttttttt",row);
386 382
   setGInviteData({ visible: true, groupActivityId: row.groupActivityId, groupStatus: row.status, recordId: row.recordId})
387 383
 }
388 384
  // 核销
389
- function helpInitiateRecordVerify(row) {
385
+ function shareRecordVerify(row) {
390 386
 // 关闭助力记录弹框
391 387
 // eslint-disable-next-line max-len
392
-  setVerifierData({ visible: true, helpRecordInitiateId: row.helpRecordInitiateId})
388
+  setVerifierData({ visible: true, groupActivityId: row.groupActivityId, groupStatus: 0})
393 389
   // eslint-disable-next-line max-len
394
-  setGInviteData({ visible: false, helpRecordInitiateId: row.helpRecordInitiateId})
390
+  setGInviteData({ visible: false, groupActivityId: row.groupActivityId})
391
+ }
392
+
393
+ function onSuccess(e) {
394
+  setVerifierData({ visible: false, groupActivityId: '', groupStatus: 0})
395
+  getList({ pageNumber: 1, pageSize: 10, ...e});
395 396
  }
396 397
 
397 398
   const publicColumns = [
@@ -482,7 +483,7 @@ function helpRecord(row) {
482 483
         <>
483 484
           {row.verificationStatus === 0 &&
484 485
           <AuthButton name="admin.SignList.get" noRight={null}>
485
-           <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={(e) => helpInitiateRecordVerify(row)}>核销</span>
486
+           <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={(e) => shareRecordVerify(row)}>核销</span>
486 487
           </AuthButton>
487 488
         }
488 489
         </>
@@ -538,7 +539,7 @@ function helpRecord(row) {
538 539
       }
539 540
        <InviteTable visibleData={gInviteData} />
540 541
        {/* 核销 */}
541
-       <Verifier visibleData={gVerifierData} />
542
+       <Verifier visibleData={gVerifierData} onSuccess={(e) => onSuccess(e)} />
542 543
     </>
543 544
   );
544 545
 }

+ 5
- 0
src/services/apis.js Ver fichero

@@ -816,6 +816,11 @@ export default {
816 816
     url: `${prefix}/taShareRecord/export`,
817 817
     method: 'get',
818 818
     action: 'admin.taRole.get',
819
+  },
820
+  verification: {
821
+    url: `${prefix}/taShareRecord/verificate`,
822
+    method: 'put',
823
+    action: 'admin.taRole.get',
819 824
   }
820 825
  },
821 826
  third: {