Sfoglia il codice sorgente

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

周立森 5 anni fa
parent
commit
7ea2f1a212

+ 6
- 13
config/routes.js Vedi File

@@ -413,23 +413,16 @@ export default [
413 413
                 hideInMenu: true,
414 414
                 component: './system/editPolicy',
415 415
               },
416
-            ],
417
-          },
418
-          {
419
-            path: '/third',
420
-            name: '第三方管理',
421
-            component: '../layouts/BlankLayout',
422
-            routes: [
423 416
               {
424
-                path: '/third/thirdList',
425
-                name: '第三方公司',
426
-                component: './third/thirdList',
417
+                path: '/system/document/list',
418
+                name: '客户资料',
419
+                component: './system/document/list',
427 420
               },
428 421
               {
429
-                path: '/third/editThirdParty',
430
-                name: '编辑活动',
422
+                path: '/system/document/audit',
423
+                name: '客户资料审核',
431 424
                 hideInMenu: true,
432
-                component: './third/editThirdParty',
425
+                component: './system/document/audit',
433 426
               },
434 427
             ],
435 428
           },

+ 1
- 0
package.json Vedi File

@@ -60,6 +60,7 @@
60 60
     "react-copy-to-clipboard": "^5.0.1",
61 61
     "react-document-title": "^2.0.3",
62 62
     "react-dom": "^16.8.6",
63
+    "react-zmage": "^0.8.5",
63 64
     "redux": "^4.0.1",
64 65
     "umi": "^2.8.7",
65 66
     "umi-plugin-pro-block": "^1.3.2",

+ 36
- 0
src/components/ZmageImg/ZmageImg.jsx Vedi File

@@ -0,0 +1,36 @@
1
+import React from 'react'
2
+import Zmage from 'react-zmage'
3
+
4
+function body(props) {
5
+  return (
6
+    <>
7
+      <Zmage
8
+        style={props.style}
9
+        src={props.src}
10
+        // alt="0"
11
+        backdrop="linear-gradient(90deg, rgba(86,81,81,0.7) 0%, rgba(86,81,81, 0.7) 100%)"
12
+        radius={5}
13
+        edge={20}
14
+        animate={{
15
+          flip: 'fade',
16
+        }}
17
+        controller={{
18
+          // 关闭按钮
19
+          close: false,
20
+          // 缩放按钮
21
+          zoom: false,
22
+          // 下载按钮
23
+          download: false,
24
+          // 旋转按钮
25
+          rotate: false,
26
+          // 翻页按钮
27
+          flip: true,
28
+          // 多页指示
29
+          pagination: true,
30
+        }}
31
+      />
32
+    </>
33
+  )
34
+}
35
+
36
+export default body

+ 13
- 10
src/pages/activity/groupActivity/editGroupActivity.jsx Vedi File

@@ -29,20 +29,22 @@ const { TextArea } = Input;
29 29
 const Edit = props => {
30 30
   const [tab, changeTab] = useState('basic')
31 31
   // 判断是否展示助力次数的输入框
32
-  // const [help, helpTab] = useState('1')
33 32
   const { groupActivityId } = props.location.query
34 33
   const [dynamicData, setDynamicData] = useState({ isEnlist: 1 })
34
+  const [scoreData, setScoreData] = useState({})
35
+  useEffect(() => {
36
+    request(apis.groupActivity.avgScore).then((data) => {
37
+      setScoreData(data);
38
+    })
39
+  }, [])
35 40
   if (groupActivityId) {
36
-    // eslint-disable-next-line react-hooks/rules-of-hooks
37 41
     useEffect(() => {
38
-      // eslint-disable-next-line no-use-before-define
39 42
       getDynamicData(groupActivityId);
40 43
     }, [])
41 44
 
42 45
     // 详情
43 46
     const getDynamicData = (groupActivityId) => {
44 47
       request({ ...apis.groupActivity.details, urlData: { id: groupActivityId } }).then((data) => {
45
-        console.log(data)
46 48
         setDynamicData(data)
47 49
       })
48 50
     }
@@ -83,7 +85,7 @@ const Edit = props => {
83 85
         name: 'mainImg',
84 86
         type: FieldTypes.ImageUploader,
85 87
         value: dynamicData.mainImg,
86
-        help: '建议图片尺寸:750px*560px',
88
+        help: '建议尺寸375*312px',
87 89
       },
88 90
       {
89 91
         label: '活动时间',
@@ -100,6 +102,7 @@ const Edit = props => {
100 102
         name: 'groupBuyPeople',
101 103
         type: FieldTypes.Text,
102 104
         value: dynamicData.groupBuyPeople,
105
+        help: '注:成团所需人数',
103 106
         rules: [
104 107
           { required: true, message: '请输入成团人数' },
105 108
         ]
@@ -109,6 +112,7 @@ const Edit = props => {
109 112
         name: 'integral',
110 113
         type: FieldTypes.Text,
111 114
         value: dynamicData.integral,
115
+        help: '注:用户平均积分' + scoreData.averageScore,
112 116
         rules: [
113 117
           { required: true, message: '请输入所需积分' },
114 118
         ]
@@ -118,7 +122,7 @@ const Edit = props => {
118 122
         name: 'descImg',
119 123
         type: FieldTypes.ImageUploader,
120 124
         value: dynamicData.descImg,
121
-        help: '建议图片尺寸:750px*560px',
125
+        help: '建议宽度:335px,高度不限',
122 126
       },
123 127
     ]
124 128
 
@@ -160,7 +164,6 @@ const Edit = props => {
160 164
       console.log(groupActivityId, 'groupActivityId')
161 165
       useEffect(() => {
162 166
         request({ ...apis.activity.poster, params: { targetId: groupActivityId, targetType: 'groupActivity' } }).then((data) => {
163
-          console.log(data, "2222")
164 167
           if (data.length > 0) {
165 168
             setPosterId(data[0].posterId)
166 169
             changeImg(data[0].posterImg)
@@ -334,9 +337,9 @@ const Edit = props => {
334 337
     <div>
335 338
       <div>
336 339
         <Radio.Group value={tab} buttonStyle="solid" onChange={e => changeTab(e.target.value)}>
337
-          <Radio.Button value="basic">基本信息1</Radio.Button>
338
-          <Radio.Button value="poster">海报图片1</Radio.Button>
339
-          <Radio.Button value="share">分享设置1</Radio.Button>
340
+          <Radio.Button value="basic">基本信息</Radio.Button>
341
+          <Radio.Button value="poster">海报图片</Radio.Button>
342
+          <Radio.Button value="share">分享设置</Radio.Button>
340 343
         </Radio.Group>
341 344
       </div>
342 345
       <div>

+ 17
- 6
src/pages/activity/helpActivity/edithelpActivity.jsx Vedi File

@@ -80,6 +80,19 @@ const header = props => {
80 80
           values.helpNum = 0
81 81
         }
82 82
 
83
+        // 判断助力人数不得超过200
84
+        if (values.helpNum > 200) {
85
+          message.error('限制助力人数不能超过200')
86
+          return
87
+        }
88
+
89
+        // 判断助力人数必须大于0
90
+        if (values.isEnlist === 1) {
91
+        if (values.helpNum <= 0) {
92
+          message.error('限制助力人数必须大于1')
93
+          return
94
+        }
95
+      }
83 96
         const { activityTime, signupTime, ...submitValue } = values
84 97
         const [startDate, endDate] = activityTime
85 98
         submitValue.startDate = moment(startDate).format('YYYY-MM-DD HH:mm');
@@ -135,9 +148,8 @@ const header = props => {
135 148
         })(<Input />)}
136 149
         </Form.Item>
137 150
 
138
-        <Form.Item label="活动主图">
151
+        <Form.Item label="活动主图" help="建议尺寸375*312px">
139 152
           {getFieldDecorator('img')(<ImageUploader />)}
140
-          <span>建议图片尺寸:750px*560px</span>
141 153
         </Form.Item>
142 154
 
143 155
         <Form.Item label="活动时间">
@@ -180,7 +192,7 @@ const header = props => {
180 192
         )}
181 193
         </Form.Item>
182 194
          {
183
-           isEnlist === 1 && <Form.Item label="请输入助力人数">
195
+           isEnlist === 1 && <Form.Item label="请输入助力人数" min={1} max={10}>
184 196
            {getFieldDecorator('helpNum', {
185 197
              rules: [
186 198
                {
@@ -188,13 +200,12 @@ const header = props => {
188 200
                  message: '请输入助力人数',
189 201
                },
190 202
              ],
191
-           })(<Input type="number" />)}
203
+           })(<Input type="number" placeholder="助力人数限制"/>)}
192 204
            </Form.Item>
193 205
          }
194 206
 
195
-        <Form.Item label="活动说明">
207
+        <Form.Item label="活动说明" help="建议宽度:335px,高度不限">
196 208
           {getFieldDecorator('activityInstructions')(<ImageUploader />)}
197
-          <span>建议图片尺寸:750px*560px</span>
198 209
         </Form.Item>
199 210
         <Form.Item wrapperCol={{ span: 12, offset: 8 }}>
200 211
           <Button type="primary" htmlType="submit">

+ 11
- 6
src/pages/activity/helpActivity/helpRecord.jsx Vedi File

@@ -293,7 +293,7 @@ function body(props) {
293 293
     e.preventDefault();
294 294
     props.form.validateFields((err, values) => {
295 295
       if (!err) {
296
-        getList({ pageNum: 1, pageSize: 10, customerType, ...values })
296
+        getList({ pageNum: 1, pageSize: 10, status: customerType, ...values, helpActivityId })
297 297
       }
298 298
     });
299 299
   }
@@ -324,7 +324,7 @@ function body(props) {
324 324
 
325 325
   function handleReset() {
326 326
     props.form.resetFields();
327
-    getList({ pageNumber: 1, pageSize: 10, customerType })
327
+    getList({ pageNum: 1, pageSize: 10, status: customerType, helpActivityId })
328 328
   }
329 329
 
330 330
   function toCustomerDateil(record) {
@@ -338,8 +338,7 @@ function body(props) {
338 338
 
339 339
   function exportCustomer () {
340 340
     const fieldsValue = getFieldsValue()
341
-    const code = customerType === 'helpSucceed' ? 1 : 0
342
-    request({ ...apis.helpActivity.HelpInitiateRecordSucceed, responseType: 'blob', params: { ...fieldsValue, customerType, helpActivityId, code } })
341
+    request({ ...apis.helpActivity.HelpInitiateRecordSucceed, responseType: 'blob', params: { ...fieldsValue, customerType, helpActivityId, condition: customerType } })
343 342
       .then(response => {
344 343
         download(response)
345 344
       }).catch(error => {
@@ -373,13 +372,19 @@ function helpRecord(row) {
373 372
   // 核销
374 373
   setVerifierData({ visible: true, helpId: row.helpRecordInitiateId, helpActivityId: row.helpActivityId, elpRecordInitiateId: '', verificationCode: '' })
375 374
  }
376
-
375
+ // 核销回调
377 376
  function onSuccess(e) {
378 377
    console.log('回调:', e)
379 378
    getList(e)
380 379
      // 核销
381 380
    setVerifierData({ visible: false, helpId: '', helpActivityId: '', elpRecordInitiateId: '', verificationCode: '' })
382 381
  }
382
+ // 返回到首页
383
+ function returList(params) {
384
+  router.push({
385
+      pathname: '/activity/helpActivity/list',
386
+    });
387
+}
383 388
 
384 389
   const publicColumns = [
385 390
     {
@@ -494,7 +499,7 @@ function helpRecord(row) {
494 499
             <Button style={{ marginLeft: 8 }} onClick={handleReset}>
495 500
               重置
496 501
             </Button>
497
-            <Button style={{ marginLeft: 8 }} onClick={handleReset}>
502
+            <Button style={{ marginLeft: 8 }} onClick={returList}>
498 503
               返回
499 504
             </Button>
500 505
         </Form.Item>

+ 3
- 3
src/pages/activity/helpActivity/list.jsx Vedi File

@@ -91,7 +91,7 @@ const toEditGoods = (helpActivityId) => () => {
91 91
       align: 'center',
92 92
       render: (x, row) => (
93 93
         <>
94
-          {row.activityStatus === 1 &&
94
+          {row.activityStatus === 0 &&
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,10 +100,10 @@ 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.activityStatus === 0 &&
103
+          {row.activityStatus === 1 &&
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
-                      <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={topDynamic(row, 2)}>结束活动<Icon type="poweroff" className={styles.edit} /></span>
106
+                      {/* <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={topDynamic(row, 2)}>结束活动<Icon type="poweroff" className={styles.edit} /></span> */}
107 107
             <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 0)}>{ row.weight === 1 ? '取消置顶' : '置顶' }<Icon type="vertical-align-top" className={styles.edit} /></span>
108 108
             <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 1)}>{ row.isMain === true ? '取消推首页' : '推首页' }<Icon type="vertical-align-top" className={styles.edit} /></span>
109 109
             </AuthButton>

+ 24
- 0
src/pages/system/document/audit.jsx Vedi File

@@ -0,0 +1,24 @@
1
+import React from 'react'
2
+import { Col, Row, Button } from 'antd'
3
+import ZmageImg from '../../../components/ZmageImg/ZmageImg'
4
+
5
+function body(props) {
6
+  return (
7
+    <>
8
+      <div style={{ background: '#ECECEC', padding: '30px' }}>
9
+        <Row gutter={16}>
10
+          <Col span={6}>
11
+            <ZmageImg style={{ width: '300px', height: '400px' }} src="https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1571303731819-1.jpg" />
12
+          </Col>
13
+        </Row>
14
+      </div>
15
+      <div style={{ marginTop: '10px', display: 'flex', justifyContent: 'center' }}>
16
+        <Button type="primary">通过</Button>
17
+        &nbsp;&nbsp;&nbsp;&nbsp;
18
+        <Button>不通过</Button>
19
+      </div>
20
+    </>
21
+  )
22
+}
23
+
24
+export default body

+ 99
- 0
src/pages/system/document/list.jsx Vedi File

@@ -0,0 +1,99 @@
1
+import React, { useState } from 'react'
2
+import { Table, Form, Icon, Input, Button  } from 'antd'
3
+
4
+function body(props) {
5
+  // eslint-disable-next-line react-hooks/rules-of-hooks
6
+  const [dataSource, setDataSource] = useState({ records: [] })
7
+
8
+  /**
9
+   * 提交
10
+   * @param e
11
+   */
12
+  function handleSubmit(e) {
13
+    e.preventDefault();
14
+    props.form.validateFields((err, values) => {
15
+      if (!err) {
16
+        console.log('Received values of form: ', values);
17
+      }
18
+    });
19
+  }
20
+
21
+  /**
22
+   * 翻页
23
+   * @param page
24
+   * @param pageSize
25
+   */
26
+  function onPageNum(page, pageSize) {
27
+    console.log(page, pageSize)
28
+  }
29
+
30
+  /**
31
+   * 重置
32
+   */
33
+  function handleReset(e) {
34
+    props.form.resetFields();
35
+  }
36
+
37
+  const columns = [
38
+    {
39
+      title: '姓名',
40
+      dataIndex: 'name',
41
+      key: 'name',
42
+    },
43
+    {
44
+      title: '手机号',
45
+      dataIndex: 'phone',
46
+      key: 'phone',
47
+    },
48
+    {
49
+      title: '提交时间',
50
+      dataIndex: 'createDate',
51
+      key: 'createDate',
52
+    },
53
+    {
54
+      title: '状态',
55
+      dataIndex: 'status',
56
+      key: 'status',
57
+    },
58
+    {
59
+      title: '操作',
60
+      dataIndex: 'documentVerifyId',
61
+      key: 'documentVerifyId',
62
+    },
63
+  ]
64
+
65
+  const { getFieldDecorator, getFieldsError, getFieldError, isFieldTouched } = props.form;
66
+  return (
67
+    <>
68
+      <Form layout="inline" onSubmit={handleSubmit}>
69
+        <Form.Item>
70
+          {getFieldDecorator('username')(
71
+            <Input
72
+              placeholder="用户名"
73
+            />,
74
+          )}
75
+        </Form.Item>
76
+        <Form.Item>
77
+          {getFieldDecorator('phone')(
78
+            <Input
79
+              placeholder="手机号"
80
+            />,
81
+          )}
82
+        </Form.Item>
83
+        <Form.Item>
84
+          <Button type="primary" htmlType="submit">
85
+            查询
86
+          </Button>
87
+          &nbsp;&nbsp;&nbsp;&nbsp;
88
+          <Button onClick={(e) => handleReset(e)}>
89
+            清空
90
+          </Button>
91
+        </Form.Item>
92
+      </Form>
93
+      <Table dataSource={dataSource.records} pagination={{ total: dataSource.total, pageSize: dataSource.pageSize, onChange: (page, pageSize) => onPageNum(page, pageSize), defaultCurrent: 1 }} columns={columns} />
94
+    </>
95
+  )
96
+}
97
+
98
+const WrappedbodyForm = Form.create({ name: 'body' })(body)
99
+export default WrappedbodyForm

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

@@ -777,6 +777,11 @@ export default {
777 777
     method: 'get',
778 778
     action: 'admin.taRole.get',
779 779
   },
780
+  avgScore: {
781
+    url: `${prefix}/taShareActivity/avgScore`,
782
+    method: 'get',
783
+    action: 'admin.taRole.get',
784
+  },
780 785
   update: {
781 786
     url: `${prefix}/taShareActivity/update`,
782 787
     method: 'put',