瀏覽代碼

Merge branch 'v3.5' of http://git.ycjcjy.com/zhiyuxing/estateagents-admin-manager into v3.5

傅行帆 5 年之前
父節點
當前提交
fcc6f4b657

+ 0
- 129
src/pages/activity/editActivity.jsx 查看文件

@@ -214,135 +214,6 @@ const Edit = props => {
214 214
     });
215 215
   }
216 216
 
217
-  const radioOnChange = e => {
218
-    console.log(e.target.value)
219
-    setDynamicData({ ...dynamicData, isEnlist: e.target.value })
220
-  }
221
-
222
-  const Basic = (props) => {
223
-    const fields = [
224
-      {
225
-        label: '所属项目',
226
-        name: 'buildingId',
227
-        render: <BuildSelect />,
228
-        value: dynamicData.buildingId,
229
-        rules: [
230
-          { required: true, message: '请选择所属项目' },
231
-        ]
232
-      },
233
-      {
234
-        label: '主图',
235
-        name: 'imgUrl',
236
-        type: FieldTypes.ImageUploader,
237
-        value: dynamicData.imgUrl,
238
-        help: '建议图片尺寸:750px*560px',
239
-      },
240
-      {
241
-        label: '活动标题',
242
-        name: 'title',
243
-        type: FieldTypes.Text,
244
-        value: dynamicData.title,
245
-        rules: [
246
-          { required: true, message: '请输入活动标题' },
247
-        ]
248
-      },
249
-      {
250
-        label: '活动时间',
251
-        name: 'activityTime',
252
-        type: FieldTypes.RangePicker,
253
-        value: dynamicData.startDate != null ? [moment(dynamicData.startDate, 'YYYY-MM-DD HH:mm'), moment(dynamicData.endDate, 'YYYY-MM-DD HH:mm')] : null,
254
-        props: {showTime:{ format: 'HH:mm' }},
255
-        rules: [
256
-          { required: true, message: '请选择活动时间' },
257
-        ]
258
-      },
259
-      {
260
-        label: '活动地点',
261
-        name: 'address',
262
-        type: FieldTypes.Text,
263
-        value: dynamicData.address,
264
-        rules: [
265
-          { required: true, message: '请输入活动地点' },
266
-        ]
267
-      },
268
-      {
269
-        label: '活动人数',
270
-        name: 'personNum',
271
-        type: FieldTypes.Text,
272
-        value: dynamicData.personNum,
273
-        rules: [
274
-          { required: true, message: '请输入活动人数' },
275
-        ]
276
-      },
277
-      {
278
-        label: '最大报名人数',
279
-        name: 'maxEnlistByPerson',
280
-        type: FieldTypes.Text,
281
-        value: dynamicData.maxEnlistByPerson,
282
-        rules: [
283
-          { required: true, message: '请输入最大报名人数' },
284
-        ]
285
-      },
286
-      {
287
-        label: '活动详情',
288
-        name: 'desc',
289
-        render: <Wangedit />,
290
-        value: dynamicData.desc,
291
-      },
292
-      {
293
-        label: '是否需要报名',
294
-        name: 'isEnlist',
295
-        render: <Radio.Group name="radiogroup" onChange={(e) => radioOnChange(e)}>
296
-          <Radio value={1}>是</Radio>
297
-          <Radio value={0}>否</Radio>
298
-        </Radio.Group>,
299
-        value: dynamicData.isEnlist != null ? dynamicData.isEnlist - 0 : 1,
300
-      },
301
-      {
302
-        label: '报名时间',
303
-        name: 'signupTime',
304
-        // type: FieldTypes.RangePicker,
305
-        render: dynamicData.isEnlist === 1 ? (<RangePicker format={ 'YYYY/MM/DD HH:mm' } style={{ width: '100%' }} />) : '',
306
-        value: dynamicData.enlistStart != null ? [moment(dynamicData.enlistStart, 'YYYY-MM-DD HH:mm'), moment(dynamicData.enlistEnd, 'YYYY-MM-DD HH:mm')] : null,
307
-        // props: {showTime:{ format: 'HH:mm' }},
308
-        rules: [
309
-          { required: true, message: '请选择报名时间' },
310
-        ]
311
-      },
312
-    ]
313
-
314
-    const handleSubmit = val => {
315
-      let { isEnlist, activityTime, signupTime, ...submitValue } = val
316
-      const [startDate, endDate] = activityTime
317
-      submitValue.startDate = moment(startDate).format('YYYY-MM-DD HH:mm');
318
-      submitValue.endDate = moment(endDate).format('YYYY-MM-DD HH:mm');
319
-      const [enlistStart, enlistEnd] = signupTime
320
-      submitValue.enlistStart = moment(enlistStart).format('YYYY-MM-DD HH:mm');
321
-      submitValue.enlistEnd = moment(enlistEnd).format('YYYY-MM-DD HH:mm');
322
-      console.log('submit data --->', submitValue)
323
-
324
-      if (dynamicId) {
325
-        submitValue.dynamicId = dynamicId
326
-        request({ ...apis.activity.update, data: submitValue }).then((data) => {
327
-          message.info("保存成功")
328
-          cancelPage()
329
-        }).catch((err) => {
330
-          message.info(err.msg || err.message)
331
-        })
332
-      } else {
333
-        request({ ...apis.activity.add, data: submitValue }).then((data) => {
334
-          message.info("保存成功")
335
-          cancelPage()
336
-        }).catch((err) => {
337
-          message.info(err.msg || err.message)
338
-        })
339
-      }
340
-    }
341
-
342
-    return <XForm onSubmit={handleSubmit} onCancel={cancelPage} fields={fields}></XForm>
343
-  }
344
-
345
-
346 217
   const Poster = (props) => {
347 218
     const [inputValue, changeInput] = useState('')
348 219
     const [textAreaValue, changeTextArea] = useState('')

+ 15
- 15
src/pages/activity/helpActivity/edithelpActivity.jsx 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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: {