浏览代码

客户详情对接

魏熙美 5 年前
父节点
当前提交
b172dc2669
共有 3 个文件被更改,包括 70 次插入35 次删除
  1. 61
    33
      src/pages/customer/customerlist/customerDetail.jsx
  2. 5
    2
      src/pages/customer/customerlist/index.jsx
  3. 4
    0
      src/services/apis.js

+ 61
- 33
src/pages/customer/customerlist/customerDetail.jsx 查看文件

@@ -2,37 +2,60 @@ import React, { useState, useEffect } from 'react';
2 2
 import { Form, Table } from 'antd';
3 3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4 4
 import styles from './style.less';
5
+import apis from '../../../services/apis';
6
+import request from '../../../utils/request';
7
+import moment from 'moment';
5 8
 
6 9
 import router from 'umi/router';
7 10
 
8 11
 
9 12
 function header(props) {
10
-
11 13
   /**
12 14
    * @param {*} props
13 15
    * @returns
14 16
    */
15
-  const [data, setData] = useState([{ records: [] }])
17
+  // eslint-disable-next-line react-hooks/rules-of-hooks
18
+  const [data, setData] = useState([{ visitRecords: [] }])
19
+
20
+  // eslint-disable-next-line react-hooks/rules-of-hooks
21
+  useEffect(() => {
22
+    getById()
23
+  }, [])
24
+
25
+  // 查询
26
+  function getById(params) {
27
+    const { id } = props.location.query;
28
+    if (id === '' || id === undefined) {
29
+      return
30
+    }
31
+    const { url, method } = apis.customer.CustomerRecommendGet
32
+    const tempUrl = url.substring(0, url.lastIndexOf('id')).concat(id)
33
+
34
+    request({ url: tempUrl, method, params: { ...params } }).then(res => {
35
+      setData(res)
36
+    })
37
+  }
16 38
 
17 39
   const columns = [
18 40
     {
19 41
       title: '访问事件',
20
-      dataIndex: 'event',
21
-      key: 'event',
42
+      dataIndex: 'activity',
43
+      key: 'activity',
22 44
       align: 'center',
23 45
     },
24 46
     {
25 47
       title: '访问时间',
26
-      dataIndex: 'time',
27
-      key: 'time',
48
+      dataIndex: 'visitTime',
49
+      key: 'visitTime',
28 50
       align: 'center',
29 51
 
30 52
     },
31 53
     {
32 54
       title: '停留时间',
33
-      dataIndex: 'stayTime',
34
-      key: 'stayTime',
55
+      dataIndex: 'visitDuration',
56
+      key: 'visitDuration',
35 57
       align: 'center',
58
+      render: (_, record) => <span>{record.visitDuration === null ? 0 : record.visitDuration }秒</span>,
36 59
     },
37 60
   ]
38 61
   return (
@@ -40,44 +63,49 @@ function header(props) {
40 63
       <div className={styles.cardBox}>
41 64
         <div className={styles.leftBox}>
42 65
           <p className={styles.tit}>置业顾问信息</p>
43
-          <img className={styles.touxiang} src="http://img0.imgtn.bdimg.com/it/u=4246326797,2657995307&fm=26&gp=0.jpg" />
44
-          <p className={styles.infoItem}>姓名:赵海伟</p>
45
-          <p className={styles.infoItem}>部门:营销部</p>
46
-          <p className={styles.infoItem}>岗位:营销经理</p>
47
-          <p className={styles.infoItem}>号码:13160056061 </p>
48
-          <p className={styles.infoItem}>公司:葛洲坝·南京中国府</p>
49
-          <p className={styles.infoItem}>所属项目:葛洲坝·南京中国府</p>
66
+          <img className={styles.touxiang} src={ data.consultant && data.consultant.picture } />
67
+          <p className={styles.infoItem}>姓名:{ data.consultant && data.consultant.name }</p>
68
+          <p className={styles.infoItem}>部门:{ data.consultant && data.consultant.department }</p>
69
+          <p className={styles.infoItem}>岗位:{ data.consultant && data.consultant.post }</p>
70
+          <p className={styles.infoItem}>号码:{ data.consultant && data.consultant.phone } </p>
71
+          <p className={styles.infoItem}>公司:{ data.consultant && data.consultant.company } </p>
72
+          <p className={styles.infoItem}>
73
+            所属项目:
74
+            {
75
+              data.consultant && data.consultant.projects.map((item, _) => <span>{item}</span>)
76
+            }
77
+          </p>
50 78
         </div>
51 79
         <div className={styles.rightBox}>
52 80
           <p className={styles.tit}>客户信息</p>
53
-          <img className={styles.touxiang} src="http://img0.imgtn.bdimg.com/it/u=4246326797,2657995307&fm=26&gp=0.jpg" />
81
+          <img className={styles.touxiang} src={ data.picture && data.picture } />
54 82
           <div className={styles.right}>
55
-            <p className={styles.rightItem}>用户名称:董浩业</p>
56
-            <p className={styles.rightItem}>手机号码:15050893674</p>
83
+            <p className={styles.rightItem}>用户名称:{ data.name }</p>
84
+            <p className={styles.rightItem}>手机号码:{ data.phone }</p>
57 85
             <p className={styles.rightItem}>来访渠道:活动分享</p>
58 86
           </div>
59
-          <p className={styles.rightItem}>访问时长:0秒</p>
60
-          <p className={styles.rightItem}>访问次数:</p>
61
-          <p className={styles.rightItem}>预约人数:</p>
62
-          <p className={styles.rightItem}>首次访问时间:</p>
63
-          <p className={styles.rightItem}>预约到访时间:</p>
87
+          <p className={styles.rightItem}>访问时长:{ data.duration }秒</p>
88
+          <p className={styles.rightItem}>访问次数:{ data.visitTimes }</p>
89
+          <p className={styles.rightItem}>预约人数:{ data.visiteNum }</p>
90
+          <p className={styles.rightItem}>首次访问时间:{data.visitTime && moment(data.visitTime).format('YYYY-MM-DD')}</p>
91
+          <p className={styles.rightItem}>预约到访时间:{data.appointmentTime && moment(data.appointmentTime).format('YYYY-MM-DD') }</p>
64 92
           <div className={styles.rightInfo}>
65
-            <p className={styles.rightItem}>国家:</p>
66
-            <p className={styles.rightItem}>省份:</p>
67
-            <p className={styles.rightItem}>城市:</p>
93
+            <p className={styles.rightItem}>国家:{ data.country }</p>
94
+            <p className={styles.rightItem}>省份:{ data.province }</p>
95
+            <p className={styles.rightItem}>城市:{data.city }</p>
68 96
             <p className={styles.rightItem}>详细信息:</p>
69
-            <p className={styles.rightItem}>意向项目:</p>
70
-            <p className={styles.rightItem}>价格区间:</p>
71
-            <p className={styles.rightItem}>客户说明:</p>
72
-            <p className={styles.rightItem}>客户描述:</p>
73
-            <p className={styles.rightItem}>需求类型:</p>
74
-            <p className={styles.rightItem}>物业类型:</p>
97
+            <p className={styles.rightItem}>意向项目:{data.intention }</p>
98
+            <p className={styles.rightItem}>价格区间:{data.priceRange }</p>
99
+            <p className={styles.rightItem}>客户说明:{ data.verifyRemark }</p>
100
+            <p className={styles.rightItem}>客户描述:{ data.describe }</p>
101
+            <p className={styles.rightItem}>需求类型:{ data.demandType }</p>
102
+            <p className={styles.rightItem}>物业类型:{ data.realtyManageType }</p>
75 103
           </div>
76 104
         </div>
77 105
       </div>
78 106
       <div className={styles.recordBox}>
79 107
         <p className={styles.tableName}>访问记录</p>
80
-        <Table dataSource={data.records} columns={columns} pagination={false} />
108
+        <Table dataSource={data.visitRecords} columns={columns} pagination={false} />
81 109
       </div>
82 110
 
83 111
     </>

+ 5
- 2
src/pages/customer/customerlist/index.jsx 查看文件

@@ -128,9 +128,12 @@ function body(props) {
128 128
     setGVisibleData({ visible: false, customerId: '', realtyConsultant: '' })
129 129
     setStatusVisibleData({ visible: true, customerId: record.customerId, status: record.status })
130 130
   }
131
-  function toCustomerDateil() {
131
+  function toCustomerDateil(record) {
132 132
     router.push({
133 133
       pathname: '/customer/customerlist/customerDetail',
134
+      query: {
135
+        id: record.customerId,
136
+      },
134 137
     });
135 138
   }
136 139
 
@@ -191,7 +194,7 @@ function body(props) {
191 194
           &nbsp;&nbsp;
192 195
           <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showGM(record)}>调整归属</Button>
193 196
           <br />
194
-          <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={toCustomerDateil}>查看详情</Button>
197
+          <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => toCustomerDateil(record)}>查看详情</Button>
195 198
           &nbsp;&nbsp;
196 199
           <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showRecord(record)}>积分记录</Button>
197 200
         </>

+ 4
- 0
src/services/apis.js 查看文件

@@ -104,5 +104,9 @@ export default {
104 104
       method: 'GET',
105 105
       url: `${prefix}/channel/InviteClientsList`,
106 106
     },
107
+    CustomerRecommendGet: {
108
+      method: 'GET',
109
+      url: `${prefix}/customer/recommend/get/id`,
110
+    },
107 111
   },
108 112
 }