dingxin 5 years ago
parent
commit
a0d68df725

+ 5
- 5
src/pages/activity/groupActivity/editGroupActivity.jsx View File

159
     if (groupActivityId) {
159
     if (groupActivityId) {
160
       console.log(groupActivityId, 'groupActivityId')
160
       console.log(groupActivityId, 'groupActivityId')
161
       useEffect(() => {
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
           console.log(data, "2222")
163
           console.log(data, "2222")
164
           if (data.length > 0) {
164
           if (data.length > 0) {
165
             setPosterId(data[0].posterId)
165
             setPosterId(data[0].posterId)
193
             message.info(err.msg || err.message)
193
             message.info(err.msg || err.message)
194
           })
194
           })
195
         } else {
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
             setPosterId(data.posterId)
197
             setPosterId(data.posterId)
198
             message.info("保存成功")
198
             message.info("保存成功")
199
           }).catch((err) => {
199
           }).catch((err) => {
274
 
274
 
275
     if (groupActivityId) {
275
     if (groupActivityId) {
276
       useEffect(() => {
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
           console.log(data, "2222")
278
           console.log(data, "2222")
279
           if (data.length > 0) {
279
           if (data.length > 0) {
280
             setShareContentId(data[0].shareContentId)
280
             setShareContentId(data[0].shareContentId)
290
     const submitShare = () => {
290
     const submitShare = () => {
291
       if (groupActivityId) {
291
       if (groupActivityId) {
292
         if (shareContentId) {
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
             message.info("保存成功")
294
             message.info("保存成功")
295
           }).catch((err) => {
295
           }).catch((err) => {
296
             message.info(err.msg || err.message)
296
             message.info(err.msg || err.message)
297
           })
297
           })
298
         } else {
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
             setShareContentId(data.shareContentId)
300
             setShareContentId(data.shareContentId)
301
             message.info("保存成功")
301
             message.info("保存成功")
302
           }).catch((err) => {
302
           }).catch((err) => {

+ 27
- 26
src/pages/activity/groupActivity/helpRecord.jsx View File

1
 import React, { useState, useEffect } from 'react';
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
 import moment from 'moment';
3
 import moment from 'moment';
4
 import request from '../../../utils/request';
4
 import request from '../../../utils/request';
5
 import apis from '../../../services/apis';
5
 import apis from '../../../services/apis';
142
   constructor(props) {
142
   constructor(props) {
143
     super(props);
143
     super(props);
144
     this.state = {
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
   componentDidMount () {
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
   componentDidUpdate (preProps, preState) {
155
   componentDidUpdate (preProps, preState) {
157
-    const { customerId } = this.state.visibleData
156
+    const { groupActivityId } = this.state.visibleData
158
     console.log('this.state.visibleData', this.state.visibleData)
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
       this.setState({ visibleData: this.props.visibleData });
159
       this.setState({ visibleData: this.props.visibleData });
162
     }
160
     }
163
   }
161
   }
171
   // 弹框取消按钮
169
   // 弹框取消按钮
172
   handleCancel () {
170
   handleCancel () {
173
     // this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
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
     }).catch(err => {
180
     }).catch(err => {
182
       // eslint-disable-next-line no-unused-expressions
181
       // eslint-disable-next-line no-unused-expressions
183
       <Alert
182
       <Alert
193
 
192
 
194
   // eslint-disable-next-line class-methods-use-this
193
   // eslint-disable-next-line class-methods-use-this
195
   verify(e) {
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
   // eslint-disable-next-line class-methods-use-this
198
   // eslint-disable-next-line class-methods-use-this
200
   verification(e) {
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
   render () {
204
   render () {
232
 function body(props) {
231
 function body(props) {
233
   const [gInviteData, setGInviteData] = useState({ visible: false, groupActivityId : '', recordId:'',  groupStatus: ''})
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
   const { getFieldDecorator, getFieldsValue } = props.form
236
   const { getFieldDecorator, getFieldsValue } = props.form
238
 
237
 
332
     const { value } = e.target
331
     const { value } = e.target
333
     setgroupStatus(value)
332
     setgroupStatus(value)
334
     if (value == 0) { 
333
     if (value == 0) { 
335
-        console.log("success", value)
336
         getList({ pageNumber: 1, pageSize: 10, groupStatus: value, groupActivityId: groupActivityId }) }
334
         getList({ pageNumber: 1, pageSize: 10, groupStatus: value, groupActivityId: groupActivityId }) }
337
     if (value == 1 || value == 2) {
335
     if (value == 1 || value == 2) {
338
-        console.log("faile", value)
339
          getFailList({ pageNumber: 1, pageSize: 10, groupStatus: value, groupActivityId: groupActivityId })
336
          getFailList({ pageNumber: 1, pageSize: 10, groupStatus: value, groupActivityId: groupActivityId })
340
          }
337
          }
341
   }
338
   }
380
 function helpRecord(row) {
377
 function helpRecord(row) {
381
 // 关闭核销
378
 // 关闭核销
382
 // eslint-disable-next-line max-len
379
 // eslint-disable-next-line max-len
383
-  setVerifierData({ visible: false, helpRecordInitiateId: row.helpRecordInitiateId})
380
+  setVerifierData({ visible: false, groupActivityId: row.groupActivityId,  groupStatus: 0})
384
   // eslint-disable-next-line max-len
381
   // eslint-disable-next-line max-len
385
-  console.log("tttttttttt",row);
386
   setGInviteData({ visible: true, groupActivityId: row.groupActivityId, groupStatus: row.status, recordId: row.recordId})
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
 // eslint-disable-next-line max-len
387
 // eslint-disable-next-line max-len
392
-  setVerifierData({ visible: true, helpRecordInitiateId: row.helpRecordInitiateId})
388
+  setVerifierData({ visible: true, groupActivityId: row.groupActivityId, groupStatus: 0})
393
   // eslint-disable-next-line max-len
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
   const publicColumns = [
398
   const publicColumns = [
482
         <>
483
         <>
483
           {row.verificationStatus === 0 &&
484
           {row.verificationStatus === 0 &&
484
           <AuthButton name="admin.SignList.get" noRight={null}>
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
           </AuthButton>
487
           </AuthButton>
487
         }
488
         }
488
         </>
489
         </>
538
       }
539
       }
539
        <InviteTable visibleData={gInviteData} />
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 View File

816
     url: `${prefix}/taShareRecord/export`,
816
     url: `${prefix}/taShareRecord/export`,
817
     method: 'get',
817
     method: 'get',
818
     action: 'admin.taRole.get',
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
  third: {
826
  third: {