傅行帆 5 anni fa
parent
commit
5b09649618

+ 13
- 1
config/routes.js Vedi File

@@ -210,10 +210,22 @@ export default [
210 210
               },
211 211
               {
212 212
                 path: '/channel/newCustomer/dataRecord',
213
-                name: '引进注册用户',
213
+                name: '注册用户',
214 214
                 hideInMenu: true,
215 215
                 component: './channel/newCustomer/dataRecord',
216 216
               },
217
+              {
218
+                path: '/channel/newCustomer/visitNum',
219
+                name: '访问次数',
220
+                hideInMenu: true,
221
+                component: './channel/newCustomer/visitNum',
222
+              },
223
+              {
224
+                path: '/channel/newCustomer/personNum',
225
+                name: '访问人数',
226
+                hideInMenu: true,
227
+                component: './channel/newCustomer/personNum',
228
+              },
217 229
             ],
218 230
           },
219 231
           {

+ 14
- 26
src/pages/channel/newCustomer/dataRecord.jsx Vedi File

@@ -6,19 +6,9 @@ import request from '../../../utils/request';
6 6
 import AuthButton from '../../../components/AuthButton';
7 7
 
8 8
 
9
-const data = [
10
-    {
11
-        nickName: '2342',
12
-        phone: '2342',
13
-        gender: '2342',
14
-        province: '2342',
15
-    },
16
-]
17
-
18 9
 const dataRecord = props => {
19
-    //   const [data, setData] = useState({})
20
-    //   const activityId = props.id
21
-    //   const activityType = props.type
10
+    const [data, setData] = useState({})
11
+    const { targetId, targetType, channelId, targetName, buildingId, newCustomers } = props.location.query
22 12
 
23 13
     useEffect(() => {
24 14
         getList({ pageNum: 1, pageSize: 10 })
@@ -26,14 +16,12 @@ const dataRecord = props => {
26 16
     }, [])
27 17
 
28 18
     const getList = params => {
29
-        // console.log(params)
30
-        // request({ ...apis.activityDataStatis.activityAddRegist, params: { ...params, activityId: activityId, activityType: activityType, ...date } }).then(data => {
31
-        //   console.log(data)
32
-        //   props.getData()
33
-        //   setData(data)
34
-        // }).catch(e => {
35
-        //   console.log(e)
36
-        // })
19
+        request({ ...apis.channelList.newuserList, params: { ...params, targetId: targetId,targetType: targetType,channelId: channelId,buildingId: buildingId } }).then(data => {
20
+            console.log(data,"dddddddddddd")
21
+          setData(data)
22
+        }).catch(e => {
23
+          console.log(e)
24
+        })
37 25
     }
38 26
 
39 27
     const columns = [
@@ -62,9 +50,9 @@ const dataRecord = props => {
62 50
             align: 'center',
63 51
         },
64 52
         {
65
-            title: '访问次数',
66
-            dataIndex: 'personFrom',
67
-            key: 'personFrom',
53
+            title: '注册时间',
54
+            dataIndex: 'createDate',
55
+            key: 'createDate',
68 56
             align: 'center',
69 57
         },
70 58
 
@@ -97,16 +85,16 @@ const dataRecord = props => {
97 85
     return <>
98 86
         <div>
99 87
             <div>
100
-                <span>内容{}</span>
88
+                <span>内容:{targetName}</span>
101 89
                 <Button style={{ float: 'right', zIndex: 1 }} onClick={() => router.go(-1)}>
102 90
                     返回
103 91
                </Button>
104 92
             </div>
105 93
             <div style={{ marginTop: '20px'  }}>
106
-                <span>访问人数{}</span>
94
+                <span>注册用户:{newCustomers}</span>
107 95
                 <Button type="primary" style={{ float: 'right', marginBottom: '20px', zIndex: 1 }} onClick={exportActivityStats}>导出</Button>
108 96
             </div>
109
-            <Table style={{ marginTop: '30px' }} dataSource={data} columns={columns} pagination={false} rowKey="activityList" />
97
+            <Table style={{ marginTop: '30px' }} dataSource={data.records || []} columns={columns} pagination={false} rowKey="activityList" />
110 98
             {/* <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
111 99
         <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
112 100
       </div> */}

+ 23
- 3
src/pages/channel/newCustomer/index.jsx Vedi File

@@ -36,9 +36,29 @@ const qrcodelist = props => {
36 36
       }, [])
37 37
 
38 38
 
39
-    const toNewuser = () => {
39
+    const toNewuser = (record) => {
40 40
         router.push({
41 41
             pathname: '/channel/newCustomer/dataRecord',
42
+            query: {
43
+                channelId: record.channelId,
44
+                targetName: record.targetName,
45
+                targetId: record.targetId,
46
+                targetType: record.targetType,
47
+                buildingId: record.buildingId,
48
+                newCustomers: record.newCustomers,
49
+              },
50
+        });
51
+    }
52
+
53
+    const toVisitNum = (record) => {
54
+        router.push({
55
+            pathname: '/channel/newCustomer/visitNum',
56
+        });
57
+    }
58
+
59
+    const toPersonNum = (record) => {
60
+        router.push({
61
+            pathname: '/channel/newCustomer/personNum',
42 62
         });
43 63
     }
44 64
 
@@ -82,7 +102,7 @@ const qrcodelist = props => {
82 102
             dataIndex: 'visitPersons',
83 103
             key: 'visitPersons',
84 104
             align: 'center',
85
-            render: (text, record) => <Navigate onClick={() => toNewuser(record)}>{text}</Navigate>,
105
+            render: (text, record) => <Navigate onClick={() => toPersonNum(record)}>{text}</Navigate>,
86 106
 
87 107
         },
88 108
         {
@@ -90,7 +110,7 @@ const qrcodelist = props => {
90 110
             dataIndex: 'visitNum',
91 111
             key: 'visitNum',
92 112
             align: 'center',
93
-            render: (text, record) => <Navigate onClick={() => toNewuser(record)}>{text}</Navigate>,
113
+            render: (text, record) => <Navigate onClick={() => toVisitNum(record)}>{text}</Navigate>,
94 114
         },
95 115
     ];
96 116
 

+ 117
- 0
src/pages/channel/newCustomer/personNum.jsx Vedi File

@@ -0,0 +1,117 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, DatePicker } from 'antd';
3
+import router from 'umi/router';
4
+import apis from '../../../services/apis';
5
+import request from '../../../utils/request';
6
+import AuthButton from '../../../components/AuthButton';
7
+
8
+
9
+const data = [
10
+    {
11
+        nickName: '2342',
12
+        phone: '2342',
13
+        gender: '2342',
14
+        province: '2342',
15
+    },
16
+]
17
+
18
+const dataRecord = props => {
19
+    //   const [data, setData] = useState({})
20
+    //   const activityId = props.id
21
+    //   const activityType = props.type
22
+
23
+    useEffect(() => {
24
+        getList({ pageNum: 1, pageSize: 10 })
25
+
26
+    }, [])
27
+
28
+    const getList = params => {
29
+        // console.log(params)
30
+        // request({ ...apis.activityDataStatis.activityAddRegist, params: { ...params, activityId: activityId, activityType: activityType, ...date } }).then(data => {
31
+        //   console.log(data)
32
+        //   props.getData()
33
+        //   setData(data)
34
+        // }).catch(e => {
35
+        //   console.log(e)
36
+        // })
37
+    }
38
+
39
+    const columns = [
40
+        {
41
+            title: '姓名',
42
+            dataIndex: 'nickName',
43
+            key: 'nickName',
44
+            align: 'center',
45
+        },
46
+        {
47
+            title: '电话',
48
+            dataIndex: 'phone',
49
+            key: 'phone',
50
+            align: 'center',
51
+        },
52
+        {
53
+            title: '性别',
54
+            dataIndex: 'gender',
55
+            key: 'gender',
56
+            align: 'center',
57
+        },
58
+        {
59
+            title: '归属地',
60
+            dataIndex: 'province',
61
+            key: 'province',
62
+            align: 'center',
63
+        },
64
+        {
65
+            title: '访问次数',
66
+            dataIndex: 'personFrom',
67
+            key: 'personFrom',
68
+            align: 'center',
69
+        },
70
+
71
+    ]
72
+
73
+
74
+
75
+    const changePageNum = pageNumber => {
76
+        getList({ pageNum: pageNumber, pageSize: 10 })
77
+    }
78
+
79
+
80
+
81
+    const exportActivityStats = () => {
82
+
83
+        // request({ ...apis.activityDataStatis.activityAddRegistNumExport, params: { activityId: activityId, activityType: activityType, ...props.form.getFieldsValue(), ...date } }).then(data => {
84
+        //   if (!data) {
85
+        //     return
86
+        //   }
87
+        //   const url = window.URL.createObjectURL(new Blob([data]))
88
+        //   const link = document.createElement('a')
89
+        //   link.style.display = 'none'
90
+        //   link.href = url
91
+        //   link.setAttribute('download', '访问统计.xlsx')
92
+        //   document.body.append(link)
93
+        //   link.click()
94
+        // }).catch()
95
+    }
96
+
97
+    return <>
98
+        <div>
99
+            <div>
100
+                <span>内容{}</span>
101
+                <Button style={{ float: 'right', zIndex: 1 }} onClick={() => router.go(-1)}>
102
+                    返回
103
+               </Button>
104
+            </div>
105
+            <div style={{ marginTop: '20px'  }}>
106
+                <span>访问人数{}</span>
107
+                <Button type="primary" style={{ float: 'right', marginBottom: '20px', zIndex: 1 }} onClick={exportActivityStats}>导出</Button>
108
+            </div>
109
+            <Table style={{ marginTop: '30px' }} dataSource={data} columns={columns} pagination={false} rowKey="activityList" />
110
+            {/* <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
111
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
112
+      </div> */}
113
+        </div>
114
+    </>
115
+}
116
+
117
+export default dataRecord

+ 117
- 0
src/pages/channel/newCustomer/visitNum.jsx Vedi File

@@ -0,0 +1,117 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, DatePicker } from 'antd';
3
+import router from 'umi/router';
4
+import apis from '../../../services/apis';
5
+import request from '../../../utils/request';
6
+import AuthButton from '../../../components/AuthButton';
7
+
8
+
9
+const data = [
10
+    {
11
+        nickName: '2342',
12
+        phone: '2342',
13
+        gender: '2342',
14
+        province: '2342',
15
+    },
16
+]
17
+
18
+const dataRecord = props => {
19
+    //   const [data, setData] = useState({})
20
+    //   const activityId = props.id
21
+    //   const activityType = props.type
22
+
23
+    useEffect(() => {
24
+        getList({ pageNum: 1, pageSize: 10 })
25
+
26
+    }, [])
27
+
28
+    const getList = params => {
29
+        // console.log(params)
30
+        // request({ ...apis.activityDataStatis.activityAddRegist, params: { ...params, activityId: activityId, activityType: activityType, ...date } }).then(data => {
31
+        //   console.log(data)
32
+        //   props.getData()
33
+        //   setData(data)
34
+        // }).catch(e => {
35
+        //   console.log(e)
36
+        // })
37
+    }
38
+
39
+    const columns = [
40
+        {
41
+            title: '姓名',
42
+            dataIndex: 'nickName',
43
+            key: 'nickName',
44
+            align: 'center',
45
+        },
46
+        {
47
+            title: '电话',
48
+            dataIndex: 'phone',
49
+            key: 'phone',
50
+            align: 'center',
51
+        },
52
+        {
53
+            title: '性别',
54
+            dataIndex: 'gender',
55
+            key: 'gender',
56
+            align: 'center',
57
+        },
58
+        {
59
+            title: '归属地',
60
+            dataIndex: 'province',
61
+            key: 'province',
62
+            align: 'center',
63
+        },
64
+        {
65
+            title: '访问次数',
66
+            dataIndex: 'personFrom',
67
+            key: 'personFrom',
68
+            align: 'center',
69
+        },
70
+
71
+    ]
72
+
73
+
74
+
75
+    const changePageNum = pageNumber => {
76
+        getList({ pageNum: pageNumber, pageSize: 10 })
77
+    }
78
+
79
+
80
+
81
+    const exportActivityStats = () => {
82
+
83
+        // request({ ...apis.activityDataStatis.activityAddRegistNumExport, params: { activityId: activityId, activityType: activityType, ...props.form.getFieldsValue(), ...date } }).then(data => {
84
+        //   if (!data) {
85
+        //     return
86
+        //   }
87
+        //   const url = window.URL.createObjectURL(new Blob([data]))
88
+        //   const link = document.createElement('a')
89
+        //   link.style.display = 'none'
90
+        //   link.href = url
91
+        //   link.setAttribute('download', '访问统计.xlsx')
92
+        //   document.body.append(link)
93
+        //   link.click()
94
+        // }).catch()
95
+    }
96
+
97
+    return <>
98
+        <div>
99
+            <div>
100
+                <span>内容{}</span>
101
+                <Button style={{ float: 'right', zIndex: 1 }} onClick={() => router.go(-1)}>
102
+                    返回
103
+               </Button>
104
+            </div>
105
+            <div style={{ marginTop: '20px'  }}>
106
+                <span>访问人数{}</span>
107
+                <Button type="primary" style={{ float: 'right', marginBottom: '20px', zIndex: 1 }} onClick={exportActivityStats}>导出</Button>
108
+            </div>
109
+            <Table style={{ marginTop: '30px' }} dataSource={data} columns={columns} pagination={false} rowKey="activityList" />
110
+            {/* <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
111
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
112
+      </div> */}
113
+        </div>
114
+    </>
115
+}
116
+
117
+export default dataRecord

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

@@ -888,6 +888,11 @@ export default {
888 888
       method: 'GET',
889 889
       action: 'admin.channel.introductionList.get',
890 890
     },
891
+    newuserList: {
892
+      url: `${prefix}/channel/introduction/newuserList`,
893
+      method: 'GET',
894
+      action: 'admin.channel.introductionList.newuserList.get',
895
+    },
891 896
   },
892 897
   role: {
893 898
     getRoleList: {