|
@@ -1,15 +1,153 @@
|
1
|
1
|
import React, { useState, useEffect } from 'react';
|
2
|
|
-import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker, message, Upload } from 'antd';
|
|
2
|
+import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker, message, Upload, Table, Pagination } from 'antd';
|
3
|
3
|
import { FormattedMessage } from 'umi-plugin-react/locale';
|
4
|
4
|
import moment from 'moment';
|
5
|
5
|
import router from 'umi/router';
|
6
|
6
|
import apis from '../../../../services/apis';
|
|
7
|
+import BuildSelect from '../../../../components/SelectButton/BuildSelect';
|
|
8
|
+import AuthButton from '@/components/AuthButton';
|
|
9
|
+import styles from './style.less';
|
|
10
|
+import request from '../../../../utils/request';
|
7
|
11
|
|
8
|
12
|
const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
|
9
|
13
|
const { TextArea } = Input;
|
10
|
14
|
|
11
|
|
-const VisitRecord = props => {
|
12
|
|
- return <div><span>访问记录</span></div>
|
13
|
|
-}
|
|
15
|
+const header = (props) => {
|
|
16
|
+ const [ data, setData ] = useState({})
|
|
17
|
+ // const [page, changePage] = useState({})
|
|
18
|
+ const {salesBatchId} = props.salesBatchId
|
|
19
|
+
|
|
20
|
+ useEffect(() => {
|
|
21
|
+ getList({ pageNum: 1, pageSize: 10, salesBatchId : salesBatchId});
|
|
22
|
+ },[])
|
|
23
|
+
|
|
24
|
+ // 查询列表
|
|
25
|
+ const getList = (params) => {
|
|
26
|
+ request({ ...apis.house.taHouseVisit, salesBatchId : salesBatchId, params: { ...params },}).then((data) => {
|
|
27
|
+ console.log(data)
|
|
28
|
+ setData(data)
|
|
29
|
+ })
|
|
30
|
+ }
|
|
31
|
+
|
|
32
|
+ const columns = [
|
|
33
|
+ {
|
|
34
|
+ title: '头像',
|
|
35
|
+ align: 'center',
|
|
36
|
+ render: (text, records) => <img src={records.photoOravatar} width={50} height={50} />,
|
|
37
|
+ },
|
|
38
|
+ {
|
|
39
|
+ title: '昵称',
|
|
40
|
+ dataIndex: 'nameOrnick',
|
|
41
|
+ key: 'nameOrnick',
|
|
42
|
+ align: 'center',
|
|
43
|
+ },
|
|
44
|
+ {
|
|
45
|
+ title: '姓名',
|
|
46
|
+ dataIndex: 'name',
|
|
47
|
+ key: 'name',
|
|
48
|
+ align: 'center',
|
|
49
|
+ },
|
|
50
|
+ {
|
|
51
|
+ title: '手机号',
|
|
52
|
+ dataIndex: 'phone',
|
|
53
|
+ key: 'phone',
|
|
54
|
+ align: 'center',
|
|
55
|
+ },
|
|
56
|
+ {
|
|
57
|
+ title: '身份',
|
|
58
|
+ dataIndex: 'personType',
|
|
59
|
+ key: 'personType',
|
|
60
|
+ align: 'center',
|
|
61
|
+ render: (personType) => <span>{ personType === 'Realty Consultant' ? '置业顾问' : personType === 'customer' ? '用户' : '游客' }</span>
|
|
62
|
+ },
|
|
63
|
+ {
|
|
64
|
+ title: '访问时间',
|
|
65
|
+ dataIndex: 'createDate',
|
|
66
|
+ key: 'createDate',
|
|
67
|
+ align: 'center',
|
|
68
|
+ render: (x, row) => <><span>{moment(row.createDate).format('YYYY-MM-DD')}</span></>
|
|
69
|
+ },
|
|
70
|
+ {
|
|
71
|
+ title: '进入场景',
|
|
72
|
+ dataIndex: 'sceneName',
|
|
73
|
+ key: 'sceneName',
|
|
74
|
+ align: 'center',
|
|
75
|
+ render: (x, row) => <span>{ row.sceneName === 'mini_program_code' ? '扫码进入' : row.sceneName === 'search' ? '自主进入' : '小程序分享进入' }</span>
|
|
76
|
+ },
|
|
77
|
+ {
|
|
78
|
+ title: '分享内容',
|
|
79
|
+ dataIndex: 'salesBatchName',
|
|
80
|
+ key: 'salesBatchName',
|
|
81
|
+ align: 'center',
|
|
82
|
+ render: (x, row) => <span>{ row.salesBatchName }的房源列表</span>
|
|
83
|
+ },
|
|
84
|
+ ];
|
|
85
|
+
|
|
86
|
+ const changePageNum = (pageNumber) => {
|
|
87
|
+ getList({ pageNum: pageNumber, pageSize: 10, salesBatchId : props.salesBatchId, ...props.form.getFieldsValue() })
|
|
88
|
+ }
|
|
89
|
+
|
|
90
|
+ // 提交事件
|
|
91
|
+const handleSubmit = (e, props) => {
|
|
92
|
+ e.preventDefault();
|
|
93
|
+ props.form.validateFields((err, values) => {
|
|
94
|
+ if (!err) {
|
|
95
|
+ console.log('提交数据: ', values)
|
|
96
|
+ getList({ pageNum: 1, pageSize: 10, ...values})
|
|
97
|
+ }
|
|
98
|
+ });
|
|
99
|
+ }
|
14
|
100
|
|
|
101
|
+ //重置搜索
|
|
102
|
+ function handleReset() {
|
|
103
|
+ props.form.resetFields();
|
|
104
|
+ }
|
|
105
|
+
|
|
106
|
+ const { getFieldDecorator } = props.form
|
|
107
|
+ return (
|
|
108
|
+
|
|
109
|
+ <>
|
|
110
|
+ <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
|
|
111
|
+ <Form.Item>
|
|
112
|
+ {getFieldDecorator('shareType')(
|
|
113
|
+ <Select style={{ width: '180px' }} placeholder="进入场景">
|
|
114
|
+ <Option value="mini_program_code">扫码进入</Option>
|
|
115
|
+ <Option value="buddy_share">小程序分享进入</Option>
|
|
116
|
+ <Option value="search">自主进入</Option>
|
|
117
|
+ </Select>,
|
|
118
|
+ )}
|
|
119
|
+ </Form.Item>
|
|
120
|
+ <Form.Item>
|
|
121
|
+ {getFieldDecorator('showPosition')(
|
|
122
|
+ <Select style={{ width: '180px' }} placeholder="身份">
|
|
123
|
+ <Option value="Realty Consultant">置业顾问</Option>
|
|
124
|
+ <Option value="customer">用户</Option>
|
|
125
|
+ <Option value="drift">游客</Option>
|
|
126
|
+ </Select>,
|
|
127
|
+ )}
|
|
128
|
+ </Form.Item>
|
|
129
|
+ <Form.Item>
|
|
130
|
+ {getFieldDecorator('phone')(
|
|
131
|
+ <Input placeholder="手机号"/>
|
|
132
|
+ )}
|
|
133
|
+ </Form.Item>
|
|
134
|
+ <Form.Item>
|
|
135
|
+ <AuthButton name="admin.extendContent.search" noRight={null}>
|
|
136
|
+ <Button type="primary" htmlType="submit" className={styles.searchBtn}>
|
|
137
|
+ 搜索
|
|
138
|
+ </Button>
|
|
139
|
+ </AuthButton>
|
|
140
|
+ <Button style={{ marginLeft: 8 }} onClick={handleReset}>
|
|
141
|
+ 重置
|
|
142
|
+ </Button>
|
|
143
|
+ </Form.Item>
|
|
144
|
+ </Form>
|
|
145
|
+ <Table dataSource={data.records} columns={columns} pagination={false} rowKey="carouseFigureList"/>
|
|
146
|
+ <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
|
|
147
|
+ <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current}/>
|
|
148
|
+ </div>
|
|
149
|
+ </>
|
|
150
|
+ )
|
|
151
|
+}
|
|
152
|
+const VisitRecord = Form.create({ name: 'header' })(header);
|
15
|
153
|
export default VisitRecord
|