|
@@ -0,0 +1,137 @@
|
|
1
|
+import React, { useState, useEffect } from 'react';
|
|
2
|
+import { Form, Table, Pagination } from 'antd';
|
|
3
|
+import { FormattedMessage } from 'umi-plugin-react/locale';
|
|
4
|
+import publicStyle from './publicStyle.less';
|
|
5
|
+import apis from '../../../services/apis';
|
|
6
|
+import request from '../../../utils/request';
|
|
7
|
+import moment from 'moment';
|
|
8
|
+
|
|
9
|
+import router from 'umi/router';
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+function header(props) {
|
|
13
|
+ /**
|
|
14
|
+ * @param {*} props
|
|
15
|
+ * @returns
|
|
16
|
+ */
|
|
17
|
+ // eslint-disable-next-line react-hooks/rules-of-hooks
|
|
18
|
+ const [data, setData] = useState([{ visitRecords: [] }])
|
|
19
|
+ const [dataConsultant, setDataonsultant] = useState({})
|
|
20
|
+ const [intentionData, setIntentionData] = useState([])
|
|
21
|
+
|
|
22
|
+ // eslint-disable-next-line react-hooks/rules-of-hooks
|
|
23
|
+ useEffect(() => {
|
|
24
|
+ getById()
|
|
25
|
+ }, [])
|
|
26
|
+
|
|
27
|
+ // 查询
|
|
28
|
+ function getById(params) {
|
|
29
|
+ const { id } = props.location.query;
|
|
30
|
+ if (id === '' || id === undefined) {
|
|
31
|
+ return
|
|
32
|
+ }
|
|
33
|
+
|
|
34
|
+ request({ ...apis.customer.CustomerRecommendGet, urlData: { id }, params: { ...params } }).then(res => {
|
|
35
|
+ setData(res)
|
|
36
|
+ setDataonsultant(res.geoInfo)
|
|
37
|
+ })
|
|
38
|
+ }
|
|
39
|
+// 分页
|
|
40
|
+ const changePageNum = pageNumber => {
|
|
41
|
+ // getList({ pageNum: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
|
|
42
|
+ }
|
|
43
|
+ const columns = [
|
|
44
|
+ {
|
|
45
|
+ title: '访问事件',
|
|
46
|
+ dataIndex: 'activity',
|
|
47
|
+ key: 'activity',
|
|
48
|
+ align: 'center',
|
|
49
|
+ },
|
|
50
|
+ {
|
|
51
|
+ title: '访问时间',
|
|
52
|
+ dataIndex: 'visitTime',
|
|
53
|
+ key: 'visitTime',
|
|
54
|
+ align: 'center',
|
|
55
|
+
|
|
56
|
+ },
|
|
57
|
+ {
|
|
58
|
+ title: '停留时间',
|
|
59
|
+ dataIndex: 'visitDuration',
|
|
60
|
+ key: 'visitDuration',
|
|
61
|
+ align: 'center',
|
|
62
|
+ render: (_, record) => <span>{record.visitDuration === null ? 0 : record.visitDuration }秒</span>,
|
|
63
|
+ },
|
|
64
|
+ ]
|
|
65
|
+ // 意向
|
|
66
|
+ const intention = [
|
|
67
|
+ {
|
|
68
|
+ title: 'Name',
|
|
69
|
+ dataIndex: 'name',
|
|
70
|
+ width: 150,
|
|
71
|
+ render: (_, record) => <span>香颂半岛</span>,
|
|
72
|
+ },
|
|
73
|
+ {
|
|
74
|
+ title: 'Address',
|
|
75
|
+ dataIndex: 'address',
|
|
76
|
+ render: (_, record) => <span style={{ marginLeft: '55%' }}>22</span>,
|
|
77
|
+ },
|
|
78
|
+ ];
|
|
79
|
+
|
|
80
|
+for (let i = 0; i < 1; i++ ) {
|
|
81
|
+ intentionData.push({
|
|
82
|
+ key: i,
|
|
83
|
+ name: `Edward King ${i}`,
|
|
84
|
+ age: 32,
|
|
85
|
+ address: `London, Park Lane no. ${i}`,
|
|
86
|
+ });
|
|
87
|
+}
|
|
88
|
+ return (
|
|
89
|
+ <>
|
|
90
|
+ <div className={publicStyle.cardBox}>
|
|
91
|
+ {/* { console.log("data:",data),console.log("data:",dataConsultant)} */}
|
|
92
|
+ <div className={publicStyle.rightBox}>
|
|
93
|
+ <p className={publicStyle.tit}>客户信息</p>
|
|
94
|
+ <img className={publicStyle.touxiang} src={ data.picture && data.picture } />
|
|
95
|
+ <div className={publicStyle.right}>
|
|
96
|
+ <p className={publicStyle.rightItem}>用户名称:{ data.name }</p>
|
|
97
|
+ <p className={publicStyle.rightItem}>手机号码:{ data.phone }</p>
|
|
98
|
+ <p className={publicStyle.rightItem}>首次访问时间:{data.visitTime && moment(data.visitTime).format('YYYY-MM-DD')}</p>
|
|
99
|
+ </div>
|
|
100
|
+ <div className={publicStyle.Centered}>
|
|
101
|
+ <p>访问时长:{ data.duration }秒</p>
|
|
102
|
+ <p>访问次数:{ data.visitTimes }</p>
|
|
103
|
+ <p className={publicStyle.rightItem}>来访渠道:活动分享</p>
|
|
104
|
+ {/* <p>预约人数:{ data.visiteNum }</p> */}
|
|
105
|
+ </div>
|
|
106
|
+ {/* <p className={styles.rightItem}>预约到访时间:{data.appointmentTime && moment(data.appointmentTime).format('YYYY-MM-DD') }</p> */}
|
|
107
|
+ <div className={publicStyle.rightInfo}>
|
|
108
|
+ <p className={publicStyle.rightItem}>国家:{ dataConsultant && dataConsultant.country }</p>
|
|
109
|
+ <p className={publicStyle.rightItem}>省份:{ dataConsultant && dataConsultant.provience }</p>
|
|
110
|
+ <p className={publicStyle.rightItem}>城市:{dataConsultant && dataConsultant.city }</p>
|
|
111
|
+ {/* <p className={styles.rightItem}>详细信息:</p> */}
|
|
112
|
+ {/* <p className={styles.rightItem}>意向项目:{data.intention }</p> */}
|
|
113
|
+ {/* <p className={styles.rightItem}>客户说明:{ data.verifyRemark }</p> */}
|
|
114
|
+ </div>
|
|
115
|
+ </div>
|
|
116
|
+ {/* { console.log("data:",data),console.log("data:",dataConsultant)} */}
|
|
117
|
+ <div className={publicStyle.leftBoxCentre}>
|
|
118
|
+ <div className={publicStyle.tit}>
|
|
119
|
+ <span>项目名称</span>
|
|
120
|
+ <span style={{ marginLeft: '47%' }}>项目名称</span>
|
|
121
|
+ </div>
|
|
122
|
+ {/* <img className={styles.touxiang} src={ data.picture && data.picture } /> */}
|
|
123
|
+ <div className={publicStyle.infoItem}>
|
|
124
|
+ <Table columnWidth={10} showHeader={false} columns={intention} dataSource={intentionData} pagination={{ pageSize: 50 }} scroll={{ y: 240 }}/>,
|
|
125
|
+ </div>
|
|
126
|
+ </div>
|
|
127
|
+ </div>
|
|
128
|
+ <div className={publicStyle.recordBox}>
|
|
129
|
+ <p className={publicStyle.tableName}>访问记录</p>
|
|
130
|
+ <Table dataSource={data.visitRecords} columns={columns} rowKey="customerDetail" onChange={changePageNum} showQuickJumper/>
|
|
131
|
+ </div>
|
|
132
|
+ </>
|
|
133
|
+ )
|
|
134
|
+}
|
|
135
|
+const WrappedHeader = Form.create({ name: 'header' })(header);
|
|
136
|
+
|
|
137
|
+export default WrappedHeader
|