Просмотр исходного кода

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

傅行帆 5 лет назад
Родитель
Сommit
2e53e664c2

+ 17
- 0
config/routes.js Просмотреть файл

@@ -502,6 +502,23 @@ export default [
502 502
                 name: '分享记录',
503 503
                 component: './record/drainage/DrainageVisitRecordList',
504 504
               },
505
+              {
506
+                path: '/record/share/countList',
507
+                name: '销售分享统计',
508
+                component: './record/share/countList',
509
+              },
510
+              {
511
+                path: '/record/share/shareCountList',
512
+                name: '分享次数列表',
513
+                hideInMenu: true,
514
+                component: './record/share/shareCountList',
515
+              },
516
+              {
517
+                path: '/record/share/clickCountList',
518
+                name: '点击次数列表',
519
+                hideInMenu: true,
520
+                component: './record/share/clickCountList',
521
+              },
505 522
             ],
506 523
           },
507 524
           // {

+ 156
- 0
src/pages/record/share/clickCountList.jsx Просмотреть файл

@@ -0,0 +1,156 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, DatePicker, Table, Pagination } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import router from 'umi/router';
5
+import moment from 'moment';
6
+import BuildSelect from '../../../components/SelectButton/BuildSelect'
7
+import apis from '../../../services/apis';
8
+import request from '../../../utils/request'
9
+import AuthButton from '@/components/AuthButton';
10
+
11
+/**
12
+  @param {*} props
13
+  @returns
14
+ */
15
+const { Option } = Select;
16
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
17
+
18
+function record(props) {
19
+  const { getFieldDecorator } = props.form
20
+
21
+  // 获取初始化数据
22
+  const [ data, setData ] = useState({})
23
+  const personId = props.location.query.id
24
+
25
+  useEffect(() => {
26
+    getList({ pageNum: 1, pageSize: 10, personId: personId });
27
+  },[])
28
+
29
+  // 查询列表
30
+  const getList = (params) => {
31
+    request({ ...apis.activity.clickCountList, params: { ...params },}).then((data) => {
32
+        if (data){
33
+            setData(data)
34
+        }
35
+        
36
+        console.log("data:",data)
37
+    })
38
+  }
39
+
40
+  //重置搜索
41
+  function handleReset() {
42
+    props.form.resetFields();
43
+  }
44
+
45
+  function back(){
46
+    router.go(-1);
47
+  }
48
+  
49
+  // 提交事件
50
+  const handleSubmit = (e, props) => {
51
+    e.preventDefault();
52
+    props.form.validateFields((err, values) => {
53
+      if (!err) {
54
+        let {shareTime,receiveTime, ...submitValue} = values
55
+        if(null != shareTime && shareTime.length > 0){
56
+          const [startCreateDate, endCreateDate] = shareTime
57
+          submitValue.startCreateDate = moment(startCreateDate).format('YYYY-MM-DD');
58
+          submitValue.endCreateDate = moment(endCreateDate).format('YYYY-MM-DD');
59
+        }else{
60
+          submitValue.startCreateDate = null
61
+          submitValue.endCreateDate = null
62
+        }        
63
+        console.log(submitValue)
64
+        getList({ pageNum: 1, pageSize: 10, personId: personId, ...submitValue })
65
+      }
66
+    });
67
+  }
68
+
69
+  const changePageNum = (pageNumber) => {
70
+    props.form.validateFields((err, values) => {
71
+      if (!err) {
72
+        getList({ pageNum: pageNumber, pageSize: 10, personId: personId, ...values })
73
+      }
74
+    });
75
+  }
76
+
77
+  const columns = [
78
+
79
+    {
80
+      title: '分享标题',
81
+      dataIndex: 'shareTitle',
82
+      key: 'shareTitle',
83
+      align: 'center',
84
+    },
85
+    {
86
+        title: '用户名',
87
+        dataIndex: 'personName',
88
+        key: 'personName',
89
+        align: 'center',
90
+      },
91
+      {
92
+        title: '手机号',
93
+        dataIndex: 'personPhone',
94
+        key: 'personPhone',
95
+        align: 'center',
96
+      },
97
+    {
98
+      title: '访问时间',
99
+      dataIndex: 'createDate',
100
+      key: 'createDate',
101
+      align: 'center',
102
+      render: (x, row) => <><span>{`${moment(row.createDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
103
+    },
104
+  ];
105
+
106
+  return (
107
+
108
+    <>
109
+      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
110
+        <div style={{ display: 'flex' }}>
111
+            <Form.Item label="分享类型" >
112
+                {getFieldDecorator('shareType')(
113
+                <Select placeholder="分享类型" style={{ width: '200px' }}>
114
+                    <Option value="dynamic_share">报名活动</Option>
115
+                    <Option value="help_share">助力活动</Option>
116
+                    <Option value="group_share">拼团活动</Option>
117
+                    <Option value="h5_share">H5活动</Option>
118
+                    <Option value="building_share">项目</Option>
119
+                    <Option value="news_share">资讯</Option>
120
+                    <Option value="card_share">名片</Option>
121
+                </Select>,
122
+                )}
123
+            </Form.Item>
124
+          <Form.Item>
125
+            {getFieldDecorator('shareTitle')(
126
+                <Input
127
+                prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
128
+                placeholder="分享标题"
129
+                />,
130
+            )}
131
+          </Form.Item>
132
+          <Form.Item style={{position:'absolute',right:'38px'}}>
133
+            <Button style={{ marginRight: 8 }} onClick={back}>
134
+              返回
135
+            </Button>
136
+            <AuthButton name="admin.taGoods.exchange" noRight={null}>
137
+              <Button type="primary" htmlType="submit">
138
+                搜索
139
+              </Button>
140
+            </AuthButton>
141
+            <Button style={{ marginLeft: 8 }} onClick={handleReset}>
142
+              重置
143
+            </Button>
144
+          </Form.Item>
145
+        </div>
146
+      </Form>
147
+      <Table rowKey="exchangeRecords" style={{marginTop:'40px'}} dataSource={data.records} columns={columns} pagination={false} />
148
+      <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
149
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current}/>
150
+      </div>
151
+    </>
152
+  )
153
+}
154
+const WrappedHeader = Form.create({ name: 'record' })(record);
155
+
156
+export default WrappedHeader

+ 157
- 0
src/pages/record/share/countList.jsx Просмотреть файл

@@ -0,0 +1,157 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, DatePicker, Table, Pagination } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import router from 'umi/router';
5
+import moment from 'moment';
6
+import BuildSelect from '../../../components/SelectButton/BuildSelect'
7
+import apis from '../../../services/apis';
8
+import request from '../../../utils/request'
9
+import AuthButton from '@/components/AuthButton';
10
+
11
+/**
12
+  @param {*} props
13
+  @returns
14
+ */
15
+const { Option } = Select;
16
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
17
+
18
+function record(props) {
19
+  const { getFieldDecorator } = props.form
20
+
21
+  // 获取初始化数据
22
+  const [ data, setData ] = useState({})
23
+
24
+  useEffect(() => {
25
+    getList({ pageNum: 1, pageSize: 10 });
26
+  },[])
27
+
28
+  // 查询列表
29
+  const getList = (params) => {
30
+    request({ ...apis.activity.saleCountList, params: { ...params },}).then((data) => {
31
+        setData(data)
32
+        console.log("data:",data)
33
+    })
34
+  }
35
+
36
+  //重置搜索
37
+  function handleReset() {
38
+    props.form.resetFields();
39
+  }
40
+
41
+    // 分享详情
42
+    function shareCount(personId) {
43
+        router.push({
44
+        pathname: '/record/share/shareCountList',
45
+        query: {
46
+            id: personId,
47
+        },
48
+        });
49
+    }
50
+  
51
+    // 点击人数详情
52
+    function clickCount(personId) {
53
+      console.log('123123123213',personId)
54
+      router.push({
55
+      pathname: '/record/share/clickCountList',
56
+      query: {
57
+          id: personId,
58
+      },
59
+      });
60
+  }
61
+
62
+  // 提交事件
63
+  const handleSubmit = (e, props) => {
64
+    e.preventDefault();
65
+    props.form.validateFields((err, values) => {
66
+      if (!err) {
67
+        let {shareTime,receiveTime, ...submitValue} = values
68
+        if(null != shareTime && shareTime.length > 0){
69
+          const [startCreateDate, endCreateDate] = shareTime
70
+          submitValue.startCreateDate = moment(startCreateDate).format('YYYY-MM-DD');
71
+          submitValue.endCreateDate = moment(endCreateDate).format('YYYY-MM-DD');
72
+        }else{
73
+          submitValue.startCreateDate = null
74
+          submitValue.endCreateDate = null
75
+        }        
76
+        console.log(submitValue)
77
+        getList({ pageNum: 1, pageSize: 10, ...submitValue })
78
+      }
79
+    });
80
+  }
81
+
82
+  const changePageNum = (pageNumber) => {
83
+    props.form.validateFields((err, values) => {
84
+      if (!err) {
85
+        getList({ pageNum: pageNumber, pageSize: 10, ...values })
86
+      }
87
+    });
88
+  }
89
+
90
+  const columns = [
91
+
92
+    {
93
+      title: '项目',
94
+      dataIndex: 'buildingName',
95
+      key: 'buildingName',
96
+      align: 'center',
97
+    },
98
+    {
99
+      title: '置业顾问',
100
+      dataIndex: 'consultantName',
101
+      key: 'consultantName',
102
+      align: 'center',
103
+    },
104
+    {
105
+      title: '分享次数',
106
+      dataIndex: 'shareCount',
107
+      key: 'shareCount',
108
+      align: 'center',
109
+      render: (_, record) => <><span style={{color: 'blue',cursor: 'pointer'}} onClick={() => shareCount(record.personId)} >{record.shareCount}</span></>,
110
+    },
111
+    {
112
+      title: '点击人数',
113
+      dataIndex: 'clickNum',
114
+      key: 'clickNum',
115
+      align: 'center',
116
+      render: (_, record) => <><span style={{color: 'blue',cursor: 'pointer'}} onClick={() => clickCount(record.personId)} >{record.clickNum}</span></>,
117
+    },
118
+  ];
119
+
120
+  return (
121
+
122
+    <>
123
+      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
124
+        <div style={{ display: 'flex' }}>
125
+           <Form.Item>
126
+            {getFieldDecorator('buildingId')(
127
+              <BuildSelect />,
128
+            )}
129
+          </Form.Item>
130
+          <Form.Item>
131
+            <span style={{marginRight:'10px'}}>分享时间:</span>
132
+                {getFieldDecorator('shareTime')(
133
+                  <RangePicker placeholder={['开始时间','结束时间']}/>
134
+                )}
135
+          </Form.Item>
136
+          <Form.Item style={{position:'absolute',right:'38px'}}>
137
+            <AuthButton name="admin.taGoods.exchange" noRight={null}>
138
+              <Button type="primary" htmlType="submit">
139
+                搜索
140
+              </Button>
141
+            </AuthButton>
142
+            <Button style={{ marginLeft: 8 }} onClick={handleReset}>
143
+              重置
144
+            </Button>
145
+          </Form.Item>
146
+        </div>
147
+      </Form>
148
+      <Table rowKey="exchangeRecords" style={{marginTop:'40px'}} dataSource={data.records} columns={columns} pagination={false} />
149
+      <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
150
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current}/>
151
+      </div>
152
+    </>
153
+  )
154
+}
155
+const WrappedHeader = Form.create({ name: 'record' })(record);
156
+
157
+export default WrappedHeader

+ 141
- 0
src/pages/record/share/shareCountList.jsx Просмотреть файл

@@ -0,0 +1,141 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, DatePicker, Table, Pagination } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import router from 'umi/router';
5
+import moment from 'moment';
6
+import BuildSelect from '../../../components/SelectButton/BuildSelect'
7
+import apis from '../../../services/apis';
8
+import request from '../../../utils/request'
9
+import AuthButton from '@/components/AuthButton';
10
+
11
+/**
12
+  @param {*} props
13
+  @returns
14
+ */
15
+const { Option } = Select;
16
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
17
+
18
+function record(props) {
19
+  const { getFieldDecorator } = props.form
20
+
21
+  // 获取初始化数据
22
+  const [ data, setData ] = useState({})
23
+  const personId = props.location.query.id
24
+
25
+  useEffect(() => {
26
+    getList({ pageNum: 1, pageSize: 10, personId: personId });
27
+  },[])
28
+
29
+  // 查询列表
30
+  const getList = (params) => {
31
+    request({ ...apis.activity.shareCountList, params: { ...params },}).then((data) => {
32
+        setData(data)
33
+        console.log("data:",data)
34
+    })
35
+  }
36
+
37
+  //重置搜索
38
+  function handleReset() {
39
+    props.form.resetFields();
40
+  }
41
+
42
+  function back(){
43
+    router.go(-1);
44
+  }
45
+  
46
+  // 提交事件
47
+  const handleSubmit = (e, props) => {
48
+    e.preventDefault();
49
+    props.form.validateFields((err, values) => {
50
+      if (!err) {
51
+        let {shareTime,receiveTime, ...submitValue} = values
52
+        if(null != shareTime && shareTime.length > 0){
53
+          const [startCreateDate, endCreateDate] = shareTime
54
+          submitValue.startCreateDate = moment(startCreateDate).format('YYYY-MM-DD');
55
+          submitValue.endCreateDate = moment(endCreateDate).format('YYYY-MM-DD');
56
+        }else{
57
+          submitValue.startCreateDate = null
58
+          submitValue.endCreateDate = null
59
+        }        
60
+        console.log(submitValue)
61
+        getList({ pageNum: 1, pageSize: 10, personId: personId, ...submitValue })
62
+      }
63
+    });
64
+  }
65
+
66
+  const changePageNum = (pageNumber) => {
67
+    props.form.validateFields((err, values) => {
68
+      if (!err) {
69
+        getList({ pageNum: pageNumber, pageSize: 10, personId: personId, ...values })
70
+      }
71
+    });
72
+  }
73
+
74
+  const columns = [
75
+
76
+    {
77
+      title: '分享标题',
78
+      dataIndex: 'shareTitle',
79
+      key: 'shareTitle',
80
+      align: 'center',
81
+    },
82
+    {
83
+      title: '分享时间',
84
+      dataIndex: 'createDate',
85
+      key: 'createDate',
86
+      align: 'center',
87
+      render: (x, row) => <><span>{`${moment(row.createDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
88
+    },
89
+  ];
90
+
91
+  return (
92
+
93
+    <>
94
+      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
95
+        <div style={{ display: 'flex' }}>
96
+            <Form.Item label="分享类型" >
97
+                {getFieldDecorator('shareType')(
98
+                <Select placeholder="分享类型" style={{ width: '200px' }}>
99
+                    <Option value="activity">报名活动</Option>
100
+                    <Option value="help">助力活动</Option>
101
+                    <Option value="group">拼团活动</Option>
102
+                    <Option value="h5">H5活动</Option>
103
+                    <Option value="project">项目</Option>
104
+                    <Option value="news">资讯</Option>
105
+                    <Option value="consultant">名片</Option>
106
+                </Select>,
107
+                )}
108
+            </Form.Item>
109
+          <Form.Item>
110
+            {getFieldDecorator('shareTitle')(
111
+                <Input
112
+                prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
113
+                placeholder="分享标题"
114
+                />,
115
+            )}
116
+          </Form.Item>
117
+          <Form.Item style={{position:'absolute',right:'38px'}}>
118
+            <Button style={{ marginRight: 8 }} onClick={back}>
119
+              返回
120
+            </Button>
121
+            <AuthButton name="admin.taGoods.exchange" noRight={null}>
122
+              <Button type="primary" htmlType="submit">
123
+                搜索
124
+              </Button>
125
+            </AuthButton>
126
+            <Button style={{ marginLeft: 8 }} onClick={handleReset}>
127
+              重置
128
+            </Button>
129
+          </Form.Item>
130
+        </div>
131
+      </Form>
132
+      <Table rowKey="exchangeRecords" style={{marginTop:'40px'}} dataSource={data.records} columns={columns} pagination={false} />
133
+      <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
134
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current}/>
135
+      </div>
136
+    </>
137
+  )
138
+}
139
+const WrappedHeader = Form.create({ name: 'record' })(record);
140
+
141
+export default WrappedHeader

+ 15
- 0
src/services/apis.js Просмотреть файл

@@ -548,6 +548,21 @@ export default {
548 548
         method: 'GET',
549 549
         action: 'admin.taDrainageVisitRecord.get',
550 550
       },
551
+      saleCountList: {
552
+        url: `${prefix}/saleCountList`,
553
+        method: 'GET',
554
+        action: 'admin.saleCountList.get',
555
+      },
556
+      shareCountList: {
557
+        url: `${prefix}/shareCountList`,
558
+        method: 'GET',
559
+        action: 'admin.shareCountList.get',
560
+      },
561
+      clickCountList: {
562
+        url: `${prefix}/clickCountList`,
563
+        method: 'GET',
564
+        action: 'admin.clickCountList.get',
565
+      },
551 566
   },
552 567
   integralMall: {
553 568
     tdPointsRules: {