zhoulisen пре 5 година
родитељ
комит
d40cdba62a

+ 6
- 0
config/routes.js Прегледај датотеку

@@ -904,6 +904,12 @@ export default [
904 904
                 hideInMenu: true,
905 905
                 component: './qrcode/qrcodelist/add',
906 906
               },   
907
+              {
908
+                path: '/qrcode/qrcodelist/dataRecord',
909
+                name: '数据记录',
910
+                hideInMenu: true,
911
+                component: './qrcode/qrcodelist/dataRecord',
912
+              },   
907 913
             ],
908 914
           },
909 915
           // {

+ 92
- 0
src/pages/qrcode/qrcodelist/add.jsx Прегледај датотеку

@@ -0,0 +1,92 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Switch, Icon, Select, Option, message, Table, Divider, Tag, Pagination, Modal, DatePicker, Row, Col } from 'antd';
3
+import router from 'umi/router';
4
+import moment from 'moment';
5
+import AuthButton from '@/components/AuthButton';
6
+import BuildSelect from '@/components/SelectButton/BuildSelect2'
7
+import ChannelSelect from '@/components/SelectButton/channelSelect'
8
+import QrcodeType from './components/qrcodeType'
9
+import QrText from './components/qrText'
10
+import apis from '../../../services/apis';
11
+import request from '../../../utils/request';
12
+
13
+
14
+
15
+const header = props => {
16
+
17
+    // const id = props.location.query.id
18
+
19
+    const [data, setData] = useState({})
20
+
21
+    const [visible, setVisible] = useState(true)
22
+
23
+    useEffect(() => {
24
+
25
+    }, [])
26
+
27
+    function handleSubmit(e) {
28
+        e.preventDefault();
29
+        props.form.validateFields((err, values) => {
30
+            if (!err) {
31
+                console.log(values)
32
+            }
33
+        }
34
+        )
35
+    }
36
+
37
+    // switch
38
+    function onChange(checked) {
39
+        console.log(`switch to ${checked}`);
40
+        setVisible(checked)
41
+    }
42
+
43
+
44
+    const { getFieldDecorator } = props.form
45
+
46
+    return (
47
+
48
+        <>
49
+            <Form labelCol={{ span: 7 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
50
+                <Form.Item label="是否关联项目">
51
+                    {getFieldDecorator('channelName', {
52
+                        initialValue: true,
53
+                        rules: [{ required: true, message: '' }],
54
+                    })(<Switch onChange={onChange} defaultChecked />)}
55
+                </Form.Item>
56
+                {visible && <Form.Item label="关联项目">
57
+                    {getFieldDecorator('aaa', {
58
+                        rules: [{ required: true, message: '' }],
59
+                    })(<BuildSelect />)}
60
+                </Form.Item>}
61
+                <Form.Item label="二维码内容类型">
62
+                    {getFieldDecorator('333', {
63
+                        rules: [{ required: true, message: '' }],
64
+                    })(<QrcodeType visible={visible} ></QrcodeType>)}
65
+                </Form.Item>
66
+                <Form.Item label="二维码内容">
67
+                    {getFieldDecorator('444', {
68
+                        rules: [{ required: true, message: '' }],
69
+                    })(<QrText />)}
70
+                </Form.Item>
71
+                <Form.Item label="是否关联项目">
72
+                    {getFieldDecorator('chan555nelName')(
73
+                        <ChannelSelect />,
74
+                    )}
75
+                </Form.Item>
76
+
77
+                <Form.Item wrapperCol={{ span: 15, offset: 8 }}>
78
+                    <div style={{ width: '190px' }}>
79
+                        <Button type="primary" htmlType="submit">保存</Button>
80
+                        <Button onClick={() => router.go(-1)} htmlType="submit">取消</Button>
81
+                    </div>
82
+                </Form.Item>
83
+            </Form>
84
+
85
+        </>
86
+    )
87
+}
88
+
89
+
90
+
91
+const WrappedNormalLoginForm = Form.create({ name: 'header' })(header);
92
+export default WrappedNormalLoginForm

+ 98
- 0
src/pages/qrcode/qrcodelist/components/qrText.jsx Прегледај датотеку

@@ -0,0 +1,98 @@
1
+import React, { useState, useEffect, useMemo } from 'react';
2
+import { Button, Form, Modal, Pagination, Table, Input } from 'antd';
3
+import Navigate from '@/components/Navigate';
4
+import EditIcon from '@/components/EditIcon';
5
+
6
+
7
+const name = '324'
8
+
9
+const data = [
10
+    {
11
+        id: '12',
12
+        title: '234',
13
+    },
14
+]
15
+const qrText = props => {
16
+    const {
17
+        value,
18
+        onChange,
19
+        ...rest
20
+      } = props;
21
+    // const [data, setData] = useState([])
22
+    const [visible, setVisible] = useState(false);
23
+    const [info, setInfo] = useState({ title: value });
24
+
25
+    useEffect(() => {
26
+        // value?useState
27
+    }, [])
28
+
29
+    function handleSubmit(e) {
30
+        e.preventDefault();
31
+        props.form.validateFields((err, values) => {
32
+            if (!err) {
33
+                console.log(values)
34
+            }
35
+        }
36
+        )
37
+    }
38
+
39
+    const onChoice = e => {
40
+        setInfo(e)
41
+        setVisible(false)
42
+        onChange(e.id)
43
+    }
44
+
45
+    const columns = [
46
+
47
+        {
48
+            title: '标题',
49
+            dataIndex: 'title',
50
+            key: 'title',
51
+            align: 'center',
52
+
53
+        },
54
+
55
+        {
56
+            title: '操作',
57
+            dataIndex: '',
58
+            key: '2',
59
+            align: 'center',
60
+            render: (text, record) => (<EditIcon type="start" text="选择" onClick={() => onChoice(record)}></EditIcon>),
61
+        },
62
+    ];
63
+
64
+
65
+    const { getFieldDecorator } = props.form
66
+
67
+    return (
68
+        <>
69
+            <div>{info.title} <Navigate onClick={() => setVisible(true)}>请选择</Navigate></div>
70
+
71
+            <Modal
72
+                title="请选择"
73
+                visible={visible}
74
+                onCancel={() => setVisible(false)}
75
+                footer={[]}
76
+                width="500px"
77
+            >
78
+                <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
79
+                    <Form.Item>
80
+                        {getFieldDecorator('contractTemplateName')(
81
+                            <Input placeholder="请输入标题" />,
82
+                        )}
83
+                    </Form.Item>
84
+                    <Form.Item>
85
+                        <Button type="primary" htmlType="submit" >搜索 </Button>
86
+                        {/* <Button style={{ marginLeft: 8 }} onClick={handleReset}>重置</Button> */}
87
+                    </Form.Item>
88
+                </Form>
89
+                <Table columns={columns} dataSource={data} pagination={false} />
90
+                {/* <Pagination defaultCurrent={1} total={dataInfo.total} onChange={e => changePageNum(e)} current={dataInfo.current} /> */}
91
+            </Modal>
92
+        </>
93
+
94
+    )
95
+}
96
+const WrappedQrText = Form.create({ name: 'qrText' })(qrText);
97
+
98
+export default WrappedQrText

+ 83
- 0
src/pages/qrcode/qrcodelist/components/qrcodeType.jsx Прегледај датотеку

@@ -0,0 +1,83 @@
1
+import React, { useMemo } from 'react';
2
+import { Select } from 'antd';
3
+
4
+const { Option } = Select;
5
+
6
+
7
+const qrcodeType = props => {
8
+    //   const [data, setData] = useState([])
9
+    //   useEffect(() => {
10
+
11
+    //   }, [props.value])
12
+    // const visible2 = props.visible || true
13
+    const all = props.all || false
14
+
15
+    const visible = useMemo(() => (props.visible), [props.visible]);
16
+    console.log(visible, '123213')
17
+
18
+    const data = [
19
+        {
20
+            name: '项目',
21
+            value: '1',
22
+            visible: true,
23
+        },
24
+        {
25
+            name: '报名活动',
26
+            value: '2',
27
+            visible: true,
28
+        },
29
+        {
30
+            name: '助力活动',
31
+            value: '3',
32
+            visible: true,
33
+        },
34
+        {
35
+            name: '拼团活动',
36
+            value: '4',
37
+            visible: true,
38
+        },
39
+        {
40
+            name: 'H5活动',
41
+            value: '5',
42
+            visible,
43
+        },
44
+        {
45
+            name: '直播活动',
46
+            value: '6',
47
+            visible,
48
+        },
49
+        {
50
+            name: '资讯',
51
+            value: '7',
52
+            visible: true,
53
+        },
54
+        {
55
+            name: '在线选房',
56
+            value: '8',
57
+            visible: true,
58
+        },
59
+    ]
60
+
61
+
62
+    return (
63
+        // <>234</>
64
+        <Select
65
+            showSearch
66
+            value={props.value}
67
+            style={{ width: '250px' }}
68
+            placeholder="请选择二维码内容类型"
69
+            onChange={props.onChange}
70
+            // filterOption={(input, option) =>
71
+            //     // eslint-disable-next-line max-len
72
+            //     option.props.children && option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
73
+            // }
74
+        >
75
+            {all && <Option key="" value="">全部类型</Option>}
76
+            {data.map(Item => (
77
+
78
+                Item.visible ? <Option key={Item.vlaue} value={Item.value}> {Item.name} </Option> : ''
79
+            ))}
80
+        </Select>
81
+    )
82
+}
83
+export default qrcodeType

+ 109
- 0
src/pages/qrcode/qrcodelist/dataRecord.jsx Прегледај датотеку

@@ -0,0 +1,109 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Input, Menu, Dropdown, Button, Icon, Modal, message, Table, Divider, Tabs, Tag, Select, Pagination } from 'antd';
3
+import router from 'umi/router';
4
+import apis from '../../../services/apis';
5
+import request from '../../../utils/request';
6
+import Visitors from './table/visitors'
7
+import VisitNum from './table/visitNum'
8
+import Newuser from './table/newuser'
9
+import moment from 'moment';
10
+
11
+const { TabPane } = Tabs;
12
+
13
+
14
+
15
+const DataRecord = props => {
16
+
17
+    const [tab, setTab] = useState('1')
18
+    const [data, setData] = useState({})
19
+    const [showHelp, setShowHelp] = useState(false)
20
+
21
+    useEffect(() => {
22
+
23
+        // getData({ id: id, type: type })
24
+
25
+    }, [])
26
+
27
+    const getData = (params) => {
28
+
29
+        // request({ ...apis.activityDataStatis.getStatisticData, params: { ...params, } }).then((data) => {
30
+        //     console.log(data)
31
+        //     setData(data || {})
32
+        // })
33
+    }
34
+
35
+    function tabsCallback(e) {
36
+
37
+        setTab(e)
38
+    }
39
+
40
+    return <>
41
+        <div>
42
+            <div>
43
+            <Icon type="question-circle" theme="filled" style={{ fontSize: '25px', color: '#F00', marginLeft: '30px' }} onClick={() => setShowHelp(true)} />
44
+          <Modal
45
+            title="指标说明(数据会存在一定时间延迟)"
46
+            centered
47
+            visible={showHelp}
48
+            footer={null}
49
+            onCancel={() => setShowHelp(false)}
50
+          >
51
+              <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>新增注册用户:</p>
52
+            <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>通过当前二维码授权手机号的总人数</p>
53
+            <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>访问人数:</p>
54
+            <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>通过当前二维码访问小程序的总人数</p>
55
+            <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>访问次数:</p>
56
+            <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>通过当前二维码访问小程序的总次数</p>
57
+          </Modal>
58
+                <Button style={{ float: 'right', zIndex: 1 }} onClick={() => router.go(-1)}>
59
+                    返回
60
+               </Button>
61
+            </div>
62
+            <div>
63
+
64
+                <div style={{ display: 'flex', marginBottom: '33px', marginTop: '20px' }}>
65
+                    <div style={{
66
+                        textAlign: 'center', display: 'flex', justifyContent: 'center', lineHeight: '100px', background: 'linear-gradient(144deg,rgba(241,43,62,1) 0%,rgba(254,144,155,1) 100%)', height: '100px',
67
+                        borderRadius: '12px', width: '32%', marginRight: '15px'
68
+                    }}>
69
+                        <span style={{ fontSize: '20px', color: '#fff' }}>访问总人数 </span>
70
+                        <span style={{ fontSize: '46px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}>{data.visitPersons || '0'}</span>
71
+                    </div>
72
+                    <div style={{
73
+                        textAlign: 'center', display: 'flex', justifyContent: 'center', lineHeight: '100px', background: 'linear-gradient(144deg,rgba(255,126,74,1) 0%,rgba(255,196,168,1) 100%)', height: '100px',
74
+                        borderRadius: '12px', width: '32%', marginRight: '15px'
75
+                    }}>
76
+                        <span style={{ fontSize: '20px', color: '#fff' }}>访问总次数 </span>
77
+                        <span style={{ fontSize: '46px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}>{data.visitNum || '0'}</span>
78
+                    </div>
79
+                    <div style={{
80
+                        textAlign: 'center', display: 'flex', justifyContent: 'center', lineHeight: '100px', background: 'linear-gradient(137deg,rgba(107,130,230,1) 0%,rgba(152,175,251,1) 100%)', height: '100px',
81
+                        borderRadius: '12px', width: '32%', marginRight: '15px'
82
+                    }}>
83
+                        <span style={{ fontSize: '20px', color: '#fff' }}>新增注册用户 </span>
84
+                        <span style={{ fontSize: '46px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}>{data.newPersons || '0'}</span>
85
+                    </div>
86
+                </div>
87
+            </div>
88
+
89
+        </div>
90
+        <div>
91
+            <Tabs type="card" value={tab} buttonStyle="solid" onChange={e => tabsCallback(e)}>
92
+                <TabPane tab="访问人数" key="1" ></TabPane>
93
+                <TabPane tab="访问次数" key="2" ></TabPane>
94
+                <TabPane tab="新增注册用户" key="3" ></TabPane>
95
+            </Tabs>
96
+            <div style={{ marginTop: '20px' }}>
97
+                {/* 访问人数 */}
98
+                {(tab === '1' && <Visitors />)}
99
+                {/* 访问次数 */}
100
+                {(tab === '2' && <VisitNum />)}
101
+                {/* 新增注册用户 */}
102
+                {(tab === '3' && <Newuser />)}
103
+
104
+            </div>
105
+        </div>
106
+    </>
107
+}
108
+
109
+export default DataRecord

+ 101
- 53
src/pages/qrcode/qrcodelist/index.jsx Прегледај датотеку

@@ -7,7 +7,6 @@ import withActions from '@/components/ActionList';
7 7
 import EditIcon from '@/components/EditIcon';
8 8
 import Navigate from '@/components/Navigate';
9 9
 import styles from '../../style/GoodsList.less';
10
-import SelectCity from '../../../components/SelectButton/CitySelect'
11 10
 import BuildSelect from '@/components/SelectButton/BuildSelect'
12 11
 import ChannelSelect from '@/components/SelectButton/channelSelect'
13 12
 import apis from '../../../services/apis';
@@ -15,11 +14,13 @@ import request from '../../../utils/request';
15 14
 
16 15
 // import RaiseHelpDoc from '../edit/components/RaiseHelpDoc';
17 16
 
17
+const data = [{
18
+    id: '1',
19
+}]
18 20
 
19
-
20
-const header = props => {
21
-    const [data, setData] = useState()
22
-
21
+const qrcodelist = props => {
22
+    // const [data, setData] = useState([])
23
+    const [showHelp, setShowHelp] = useState(false)
23 24
 
24 25
     // 查询列表
25 26
     //   const getList = params => {
@@ -34,13 +35,17 @@ const header = props => {
34 35
     //     getList({ pageNum: 1, pageSize: 10 });
35 36
     //   }, [])
36 37
 
37
-    //   const toAdd = rowData => () => {
38
-    //     router.push({
39
-    //       pathname: '/eContract/template/add',
40
-    //     });
41
-    //   }
42
-
38
+    const toAdd = () => {
39
+        router.push({
40
+            pathname: '/qrcode/qrcodelist/add',
41
+        });
42
+    }
43 43
 
44
+    const toDataRecord = () => {
45
+        router.push({
46
+            pathname: '/qrcode/qrcodelist/dataRecord',
47
+        });
48
+    }
44 49
 
45 50
     /**
46 51
      *
@@ -48,45 +53,74 @@ const header = props => {
48 53
      * @param {*} props
49 54
      * @returns
50 55
      */
51
-    //   const columns = [
52
-    //     {
53
-    //       title: '合同标题',
54
-    //       dataIndex: 'contractTemplateName',
55
-    //       key: 'contractTemplateName',
56
-    //       align: 'center',
57
-    //       render:  (x, row) => <Navigate onClick={toDetail(row)}>{row.contractTemplateName}</Navigate>,
58
-    //     },
59
-    //     {
60
-    //       title: '新增时间',
61
-    //       dataIndex: 'createDate',
62
-    //       key: 'createDate',
63
-    //       align: 'center',
64
-    //       render: (x, row) => <><span>{`${moment(row.createDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
65
-    //     },
66
-    //     {
67
-    //       title: '操作',
68
-    //       dataIndex: '',
69
-    //       key: '',
70
-    //       align: 'center',
71
-    //       render: withActions((text, record) => [(
72
-    //           <AuthButton name="admin.eContractTemplate.detail.get" noRight={null}>
73
-    //             <EditIcon type="look" text="查看详情" onClick={toDetail(record)}></EditIcon>
74
-    //           </AuthButton>
75
-    //       ),])
76
-    //     },
77
-    //   ];
56
+    const columns = [
57
+        {
58
+            title: '二维码',
59
+            dataIndex: 'contractTemplateName',
60
+            key: 'contractTemplateName',
61
+            align: 'center',
62
+            render: (x, row) => <Navigate >{row.contractTemplateName}</Navigate>,
63
+        },
64
+        {
65
+            title: '二维码内容',
66
+            dataIndex: 'createDate',
67
+            key: 'createDate',
68
+            align: 'center',
69
+
70
+        },
71
+        {
72
+            title: '二维码类型',
73
+            dataIndex: 'createDate',
74
+            key: 'createDate',
75
+            align: 'center',
76
+
77
+        },
78
+        {
79
+            title: '关联项目',
80
+            dataIndex: 'createDate',
81
+            key: 'createDate',
82
+            align: 'center',
83
+
84
+        },
85
+        {
86
+            title: '关联渠道',
87
+            dataIndex: 'createDate',
88
+            key: 'createDate',
89
+            align: 'center',
90
+
91
+        },
92
+        {
93
+            title: '创建时间',
94
+            dataIndex: 'createDate',
95
+            key: 'createDate',
96
+            align: 'center',
97
+
98
+        },
99
+        {
100
+            title: '操作',
101
+            dataIndex: '',
102
+            key: '',
103
+            align: 'center',
104
+            render: withActions((text, record) => [
105
+                <EditIcon type="download" text="下载二维码" ></EditIcon>,
106
+
107
+                <EditIcon type="data" text="数据" onClick={() => toDataRecord(record.id)} ></EditIcon>,
108
+
109
+            ]),
110
+        },
111
+    ];
78 112
 
79 113
 
80 114
     //   const changePageNum = pageNumber => {
81 115
     //     getList({ pageNum: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
82 116
     //   }
83 117
 
84
-    //   const rowSelection = {
85
-    //     onChange: (selectedRowKeys, selectedRows) => {
86
-    //       console.log('selectedRowKeys:', selectedRowKeys, 'selectedRows: ', selectedRows);
87
-    //       setContractList(selectedRows)
88
-    //     },
89
-    //   };
118
+    const rowSelection = {
119
+        onChange: (selectedRowKeys, selectedRows) => {
120
+            console.log('selectedRowKeys:', selectedRowKeys, 'selectedRows: ', selectedRows);
121
+            //   setContractList(selectedRows)
122
+        },
123
+    };
90 124
 
91 125
     //   // 提交事件
92 126
     //   const handleSubmit = e => {
@@ -109,8 +143,7 @@ const header = props => {
109 143
     return (
110 144
 
111 145
         <>
112
-            <div>234</div>
113
-            <Form layout="inline" onSubmit={e => handleSubmit(e)}>
146
+            <Form layout="inline" style={{ marginBottom: '10px' }} onSubmit={e => handleSubmit(e)}>
114 147
                 <Form.Item>
115 148
                     {getFieldDecorator('qrcodetype')(
116 149
                         <Input
@@ -141,18 +174,33 @@ const header = props => {
141 174
                 </Form.Item>
142 175
             </Form>
143 176
 
144
-                <Button type="danger" >新增</Button>
177
+            <Button type="danger" onClick={() => toAdd()}>新增</Button>
178
+
179
+            <Button type="primary" style={{ marginLeft: '30px' }}>删除</Button>
180
+            <Icon type="question-circle" theme="filled" style={{ fontSize: '25px', color: '#F00', marginLeft: '30px' }} onClick={() => setShowHelp(true)} />
181
+            <Modal
182
+                title="相关说明"
183
+                centereds
184
+                visible={showHelp}
185
+                footer={null}
186
+                onCancel={() => setShowHelp(false)}
187
+                width="700px"
188
+            >
189
+                <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>1、支持为小程序中的项目、活动、资讯生成单独的二维码,用于渠道投放;</p>
190
+                <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>2、同一个活动需要投放多个渠道时,需要生成多个二维码;</p>
191
+                <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>3、点击每个二维码列表的“数据记录”可查看对应的获客记录</p>
192
+
145 193
 
146
-                <Button type="primary" style={{ marginLeft: '30px' }}>删除</Button>
194
+            </Modal>
147 195
 
148
-            {/* <Table rowSelection={rowSelection}
149
-       dataSource={data.records} columns={columns} pagination={false} rowKey={r => r.contractTemplateId} />
150
-      <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
196
+            <Table rowSelection={rowSelection}
197
+                dataSource={data} columns={columns} pagination={false} rowKey={r => r.id} />
198
+            {/* <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
151 199
         <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={e => changePageNum(e)} current={data.current}/>
152 200
       </div> */}
153 201
         </>
154 202
     )
155 203
 }
156
-const WrappedHeader = Form.create({ name: 'header' })(header);
204
+const WrappedQrcodelist = Form.create({ name: 'qrcodelist' })(qrcodelist);
157 205
 
158
-export default WrappedHeader
206
+export default WrappedQrcodelist

+ 97
- 0
src/pages/qrcode/qrcodelist/table/newuser.jsx Прегледај датотеку

@@ -0,0 +1,97 @@
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
+import WxDictSelect from '@/components/SelectButton/WxDictSelect';
8
+import moment from 'moment';
9
+
10
+
11
+const newuser = props => {
12
+  const [showHelp, setShowHelp] = useState(false)
13
+  const [data, setData] = useState({})
14
+
15
+
16
+  useEffect(() => {
17
+    // console.log(activityId, activityType)
18
+    // getList({ pageNum: 1, pageSize: 10 })
19
+
20
+  }, [])
21
+
22
+  const getList = params => {
23
+    // console.log(params)
24
+    // request({ ...apis.activityDataStatis.activityAddRegist, params: { ...params, activityId: activityId, activityType: activityType, ...date } }).then(data => {
25
+    //   console.log(data)
26
+    //   props.getData()
27
+    //   setData(data)
28
+    // }).catch(e => {
29
+    //   console.log(e)
30
+    // })
31
+  }
32
+
33
+  const columns = [
34
+    {
35
+      title: '姓名',
36
+      dataIndex: 'nickName',
37
+      key: 'nickName',
38
+    },
39
+    {
40
+      title: '电话',
41
+      dataIndex: 'phone',
42
+      key: 'phone',
43
+    },
44
+    {
45
+      title: '性别',
46
+      dataIndex: 'gender',
47
+      key: 'gender',
48
+    },
49
+    {
50
+      title: '归属地',
51
+      dataIndex: 'province',
52
+      key: 'province',
53
+    },
54
+    {
55
+      title: '注册时间',
56
+      dataIndex: 'visitDate',
57
+      key: 'visitDate',
58
+      render: (x, row) => <><span>{`${moment(row.visitDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
59
+    },
60
+  ]
61
+
62
+
63
+  const changePageNum = pageNumber => {
64
+    getList({ pageNum: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
65
+  }
66
+
67
+
68
+  const exportActivityStats = () => {
69
+
70
+    request({ ...apis.activityDataStatis.activityAddRegistNumExport, params: { activityId: activityId, activityType: activityType, ...props.form.getFieldsValue(), ...date } }).then(data => {
71
+      if (!data) {
72
+        return
73
+      }
74
+      const url = window.URL.createObjectURL(new Blob([data]))
75
+      const link = document.createElement('a')
76
+      link.style.display = 'none'
77
+      link.href = url
78
+      link.setAttribute('download', '访问统计.xlsx')
79
+      document.body.append(link)
80
+      link.click()
81
+    }).catch()
82
+  }
83
+
84
+  return <>
85
+    <div>
86
+      <div>
87
+        <Button type="primary" style={{ float: 'right', marginBottom: '20px', zIndex: 1 }} onClick={exportActivityStats}>导出</Button>
88
+      </div>
89
+      <Table style={{ marginTop: '30px' }} dataSource={data.records} columns={columns} pagination={false} rowKey="activityList" />
90
+      <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
91
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
92
+      </div>
93
+    </div>
94
+  </>
95
+}
96
+
97
+export default newuser

+ 102
- 0
src/pages/qrcode/qrcodelist/table/visitNum.jsx Прегледај датотеку

@@ -0,0 +1,102 @@
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
+import WxDictSelect from '@/components/SelectButton/WxDictSelect';
8
+import moment from 'moment';
9
+
10
+const visitNum = props => {
11
+  const [data, setData] = useState({})
12
+
13
+
14
+  useEffect(() => {
15
+    // console.log(activityId, activityType)
16
+    // getList({ pageNum: 1, pageSize: 10 })
17
+
18
+  }, [])
19
+
20
+  const getList = params => {
21
+    // console.log(params)
22
+    // request({ ...apis.activityDataStatis.activityVisitNum, params: { ...params, activityId: activityId, activityType: activityType, ...date } }).then(data => {
23
+    //   console.log(data)
24
+    //   props.getData()
25
+    //   setData(data)
26
+    // }).catch(e => {
27
+    //   console.log(e)
28
+    // })
29
+  }
30
+
31
+
32
+  const columns = [
33
+    {
34
+      title: '姓名',
35
+      dataIndex: 'nickName',
36
+      key: 'nickName',
37
+    },
38
+    {
39
+      title: '电话',
40
+      dataIndex: 'phone',
41
+      key: 'phone',
42
+    },
43
+    {
44
+      title: '性别',
45
+      dataIndex: 'gender',
46
+      key: 'gender',
47
+    },
48
+    {
49
+      title: '归属地',
50
+      dataIndex: 'province',
51
+      key: 'province',
52
+    },
53
+    {
54
+      title: '访问时间',
55
+      dataIndex: 'visitDate',
56
+      key: 'visitDate',
57
+      render: (x, row) => <><span>{`${moment(row.visitDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
58
+    },
59
+  ]
60
+
61
+
62
+  const changePageNum = pageNumber => {
63
+    getList({ pageNum: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
64
+  }
65
+
66
+
67
+
68
+  const exportActivityStats = () => {
69
+
70
+    request({ ...apis.activityDataStatis.activityVisitNumExport, params: { activityId: activityId, activityType: activityType, ...props.form.getFieldsValue(), ...date } }).then(data => {
71
+      if (!data) {
72
+        return
73
+      }
74
+      const url = window.URL.createObjectURL(new Blob([data]))
75
+      const link = document.createElement('a')
76
+      link.style.display = 'none'
77
+      link.href = url
78
+      link.setAttribute('download', '访问统计.xlsx')
79
+      document.body.append(link)
80
+      link.click()
81
+    }).catch()
82
+  }
83
+
84
+  return <>
85
+    <div>
86
+      <div>
87
+
88
+
89
+        <Button type="primary" style={{ float: 'right', marginBottom: '20px', zIndex: 1 }} onClick={exportActivityStats} >
90
+          导出
91
+            </Button>
92
+
93
+      </div>
94
+      <Table style={{ marginTop: '30px' }} dataSource={data.records} columns={columns} pagination={false} rowKey="activityList" />
95
+      <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
96
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
97
+      </div>
98
+    </div>
99
+  </>
100
+}
101
+
102
+export default visitNum

+ 117
- 0
src/pages/qrcode/qrcodelist/table/visitors.jsx Прегледај датотеку

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