dingxin 5 years ago
parent
commit
9751482cc4

+ 15
- 15
src/pages/activity/helpActivity/edithelpActivity.jsx View File

@@ -178,7 +178,7 @@ const Edit = props => {
178 178
     if (helpActivityId) {
179 179
       console.log(helpActivityId, 'helpActivityId')
180 180
       useEffect(() => {
181
-        request({ ...apis.activity.poster, params: { targetId: helpActivityId, targetType: 'activity' } }).then((data) => {
181
+        request({ ...apis.activity.poster, params: { targetId: helpActivityId, targetType: 'helpActivity' } }).then((data) => {
182 182
           console.log(data, "2222")
183 183
           if (data.length > 0) {
184 184
             setPosterId(data[0].posterId)
@@ -206,13 +206,13 @@ const Edit = props => {
206 206
     const submitPoster = () => {
207 207
       if (helpActivityId) {
208 208
         if (posterId) {
209
-          request({ ...apis.activity.updatePoster, urlData: { id: posterId }, data: { targetId: helpActivityId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
209
+          request({ ...apis.activity.updatePoster, urlData: { id: posterId }, data: { targetId: helpActivityId, targetType: 'helPactivity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
210 210
             message.info("保存成功")
211 211
           }).catch((err) => {
212 212
             message.info(err.msg || err.message)
213 213
           })
214 214
         } else {
215
-          request({ ...apis.activity.addPoster, data: { targetId: helpActivityId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
215
+          request({ ...apis.activity.addPoster, data: { targetId: helpActivityId, targetType: 'helPactivity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
216 216
             setPosterId(data.posterId)
217 217
             message.info("保存成功")
218 218
           }).catch((err) => {
@@ -264,15 +264,15 @@ const Edit = props => {
264 264
 
265 265
         <div >
266 266
           <div style={{ display: 'flex', width: '100%', margin: '60px 0' }}>
267
-            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报图片1</p>
267
+            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报图片</p>
268 268
             <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
269 269
           </div>
270 270
           <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
271
-            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题1</p>
271
+            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
272 272
             <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
273 273
           </div>
274 274
           <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
275
-            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报描述1</p>
275
+            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报描述</p>
276 276
             <TextArea rows={5} value={textAreaValue} onChange={e => changeTextArea(e.target.value)} />
277 277
           </div>
278 278
 
@@ -293,7 +293,7 @@ const Edit = props => {
293 293
 
294 294
     if (helpActivityId) {
295 295
       useEffect(() => {
296
-        request({ ...apis.activity.shareContent, params: { targetId: helpActivityId, targetType: 'activity' }, }).then((data) => {
296
+        request({ ...apis.activity.shareContent, params: { targetId: helpActivityId, targetType: 'helPactivity' }, }).then((data) => {
297 297
           console.log(data, "2222")
298 298
           if (data.length > 0) {
299 299
             setShareContentId(data[0].shareContentId)
@@ -309,13 +309,13 @@ const Edit = props => {
309 309
     const submitShare = () => {
310 310
       if (helpActivityId) {
311 311
         if (shareContentId) {
312
-          request({ ...apis.activity.updateShareContent, urlData: { id: shareContentId }, data: { targetId: helpActivityId, shareContentType: 'activity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
312
+          request({ ...apis.activity.updateShareContent, urlData: { id: shareContentId }, data: { targetId: helpActivityId, shareContentType: 'helPactivity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
313 313
             message.info("保存成功")
314 314
           }).catch((err) => {
315 315
             message.info(err.msg || err.message)
316 316
           })
317 317
         } else {
318
-          request({ ...apis.activity.addShareContent, data: { targetId: helpActivityId, shareContentType: 'activity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
318
+          request({ ...apis.activity.addShareContent, data: { targetId: helpActivityId, shareContentType: 'helPactivity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
319 319
             setShareContentId(data.shareContentId)
320 320
             message.info("保存成功")
321 321
           }).catch((err) => {
@@ -329,7 +329,7 @@ const Edit = props => {
329 329
 
330 330
     return <div style={{ padding: '20px' }}>
331 331
       <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
332
-        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享模板1</p>
332
+        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享模板</p>
333 333
         <div>
334 334
           <p style={{ display: 'flex', alignItems: 'center', fontSize: '14px', color: '#999', margin: '0', lineHeight: '0' }}><img src={logo} style={{ width: '22px', marginRight: '10px' }} />知与行互动</p>
335 335
           <p style={{ fontSize: '16px', color: '#222', fontWeight: '600', margin: '0' }}>{inputValue ? inputValue : '置业V客厅 精准获客平台'}</p>
@@ -337,11 +337,11 @@ const Edit = props => {
337 337
         </div>
338 338
       </div>
339 339
       <div style={{ display: 'flex', alignItems: 'center', width: '100%' }}>
340
-        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享标题1</p>
340
+        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享标题</p>
341 341
         <Input placeholder="请输入分享标题" value={inputValue} onChange={e => changeInput(e.target.value)} />
342 342
       </div>
343 343
       <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
344
-        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享图片1</p>
344
+        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享图片</p>
345 345
         <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
346 346
       </div>
347 347
       <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
@@ -353,9 +353,9 @@ const Edit = props => {
353 353
     <div>
354 354
       <div>
355 355
         <Radio.Group value={tab} buttonStyle="solid" onChange={e => changeTab(e.target.value)}>
356
-          <Radio.Button value="basic">基本信息1</Radio.Button>
357
-          <Radio.Button value="poster">海报图片1</Radio.Button>
358
-          <Radio.Button value="share">分享设置1</Radio.Button>
356
+          <Radio.Button value="basic">基本信息</Radio.Button>
357
+          <Radio.Button value="poster">海报图片</Radio.Button>
358
+          <Radio.Button value="share">分享设置</Radio.Button>
359 359
         </Radio.Group>
360 360
       </div>
361 361
       <div>

+ 22
- 19
src/pages/activity/helpActivity/helpRecord.jsx View File

@@ -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';
@@ -123,23 +123,20 @@ class Verifier extends React.Component {
123 123
   constructor(props) {
124 124
     super(props);
125 125
     this.state = {
126
-      helpRecordInitiateId: { id: '' },
127
-      visibleData: { visible: false, customerId: '', realtyConsultant: '', helpRecordInitiateId: '' },
126
+      verification: { verificationCode: '' },
127
+      visibleData: { visible: false, customerId: '', realtyConsultant: '', helpRecordInitiateId: '', verificationCode: '' },
128 128
     }
129 129
   }
130 130
 
131 131
   // 挂载之后
132 132
   componentDidMount () {
133 133
     const { customerId } = this.state.visibleData
134
-    this.getList({ helpRecordInitiateId: customerId, pageNumber: 1, pageSize: 5 })
135 134
   }
136 135
 
137 136
   componentDidUpdate (preProps, preState) {
138 137
     const { customerId } = this.state.visibleData
139
-    console.log('this.state.visibleData', this.state.visibleData)
140 138
     if (this.props.visibleData.customerId !== preState.visibleData.customerId) {
141
-      this.getList({ helpRecordInitiateId: customerId, pageNumber: 1, pageSize: 5 })
142
-      this.setState({ visibleData: this.props.visibleData });
139
+      this.setState({ visibleData: { visible: this.props.visibleData.visible, customerId: this.props.visibleData.customerId, verificationCode: '' } })
143 140
     }
144 141
   }
145 142
 
@@ -154,9 +151,11 @@ class Verifier extends React.Component {
154 151
     this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
155 152
   }
156 153
 
154
+  // eslint-disable-next-line class-methods-use-this
157 155
   getList (params) {
158
-    request({ ...apis.helpActivity.helpPeopleDetails, params: { ...params } }).then(res => {
159
-      this.setState({ dataSource: res })
156
+    request({ ...apis.helpActivity.verification, params: { ...params } }).then(res => {
157
+      // eslint-disable-next-line no-undef
158
+      message.info('核销成功')
160 159
     }).catch(err => {
161 160
       // eslint-disable-next-line no-unused-expressions
162 161
       <Alert
@@ -172,13 +171,12 @@ class Verifier extends React.Component {
172 171
 
173 172
   // eslint-disable-next-line class-methods-use-this
174 173
   verify(e) {
175
-    console.log('111', e.target.value)
174
+    this.setState({ visibleData: { visible: true, customerId: this.props.visibleData.customerId, verificationCode: e.target.value } })
176 175
   }
177 176
 
178 177
   // eslint-disable-next-line class-methods-use-this
179 178
   verification(e) {
180
-    console.log('this.state.visibleData', this.state.visibleData)
181
-      alert(1)
179
+    this.getList({ helpRecordInitiateId: this.state.visibleData.customerId, verifyCode: this.state.visibleData.verificationCode })
182 180
   }
183 181
 
184 182
   render () {
@@ -286,7 +284,7 @@ function body(props) {
286 284
 
287 285
   // 助力成功/进行中/助力失败
288 286
   function radioButtonHandleSizeChange(e) {
289
-    setGInviteData({ visible: true, customerId: '', realtyConsultant: '' })
287
+    setGInviteData({ visible: false, customerId: '', realtyConsultant: '' })
290 288
     displayNone()
291 289
 
292 290
     const { value } = e.target
@@ -335,18 +333,23 @@ function body(props) {
335 333
 // 助力记录弹框
336 334
 function helpRecord(row) {
337 335
 // 关闭核销
338
-// eslint-disable-next-line max-len
339
-setVerifierData({ visible: false, customerId: row.helpRecordInitiateId, realtyConsultant: row.realtyConsultant })
340
-  // eslint-disable-next-line max-len
336
+console.log('gInviteData', gInviteData)
337
+
338
+
341 339
   setGInviteData({ visible: true, customerId: row.helpRecordInitiateId, realtyConsultant: row.realtyConsultant })
340
+
341
+  setVerifierData({ visible: false, customerId: row.helpRecordInitiateId, realtyConsultant: row.realtyConsultant })
342 342
 }
343 343
  // 核销
344 344
  function helpInitiateRecordVerify(row) {
345
+
346
+  console.log('gVerifierData', gVerifierData)
345 347
 // 关闭助力记录弹框
346
-// eslint-disable-next-line max-len
347
-  setVerifierData({ visible: true, customerId: row.helpRecordInitiateId, realtyConsultant: row.realtyConsultant })
348
-  // eslint-disable-next-line max-len
349 348
   setGInviteData({ visible: false, customerId: row.helpRecordInitiateId, realtyConsultant: row.realtyConsultant })
349
+
350
+  setVerifierData({ visible: true, customerId: row.helpRecordInitiateId, realtyConsultant: row.realtyConsultant })
351
+
352
+
350 353
  }
351 354
 
352 355
   const publicColumns = [

+ 6
- 6
src/pages/activity/helpActivity/list.jsx View File

@@ -79,9 +79,9 @@ const toEditGoods = (helpActivityId) => () => {
79 79
       key: 'isEnlist',
80 80
       align: 'center',
81 81
       render: (text, records) => {
82
-        if (records.status === 0) { return '未开始' }
83
-        if (records.status === 1) { return '进行中' }
84
-        if (records.status === 2) { return '已结束' }
82
+        if (records.activityStatus === 0) { return '未开始' }
83
+        if (records.activityStatus === 1) { return '进行中' }
84
+        if (records.activityStatus === 2) { return '已结束' }
85 85
       },
86 86
     },
87 87
     {
@@ -91,7 +91,7 @@ const toEditGoods = (helpActivityId) => () => {
91 91
       align: 'center',
92 92
       render: (x, row) => (
93 93
         <>
94
-          {row.status === 1 &&
94
+          {row.activityStatus === 1 &&
95 95
           <AuthButton name="admin.SignList.get" noRight={null}>
96 96
         
97 97
             <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={ getSignList.bind(this, row.helpActivityId)}>助力记录<Icon type="snippets" className={styles.shoppingCart} /></span>
@@ -100,7 +100,7 @@ const toEditGoods = (helpActivityId) => () => {
100 100
             <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 1)}>{ row.isMain === true ? '取消推首页' : '推首页' }<Icon type="vertical-align-top" className={styles.edit} /></span>
101 101
           </AuthButton> }
102 102
 
103
-          {row.status === 0 &&
103
+          {row.activityStatus === 0 &&
104 104
            <AuthButton name="admin.buildingDynamic.finish.put" noRight={null}>
105 105
                       <span style={{ color: '#FF925C', cursor: 'pointer' }} onClick={toEditGoods(row.helpActivityId)}>编辑<Icon type="form" className={styles.edit} /></span>
106 106
                       <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={topDynamic(row, 2)}>结束活动<Icon type="poweroff" className={styles.edit} /></span>
@@ -109,7 +109,7 @@ const toEditGoods = (helpActivityId) => () => {
109 109
             </AuthButton>
110 110
           }
111 111
 
112
-          {row.status === 2 &&
112
+          {row.activityStatus === 2 &&
113 113
         <AuthButton name="admin.buildingDynamic.finish.put" noRight={null}>
114 114
            <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={ getSignList.bind(this, row.helpActivityId)}>助力记录<Icon type="snippets" className={styles.shoppingCart} /></span>
115 115
            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 0)}>{ row.weight === 1 ? '取消置顶' : '置顶' }<Icon type="vertical-align-top" className={styles.edit} /></span>

+ 5
- 0
src/services/apis.js View File

@@ -714,6 +714,11 @@ export default {
714 714
     method: 'get',
715 715
     action: 'admin.taRole.get',
716 716
   },
717
+  verification: {
718
+    url: `${prefix}/helpInitiateRecordVerify`,
719
+    method: 'post',
720
+    action: 'admin.taRole.get',
721
+  },
717 722
  },
718 723
  groupActivity: {
719 724
   list: {