dingxin před 5 roky
rodič
revize
122866a831
3 změnil soubory, kde provedl 46 přidání a 33 odebrání
  1. 2
    2
      config/config.js
  2. 21
    21
      src/pages/channel/InviteClients.jsx
  3. 23
    10
      src/pages/channel/brokerList.jsx

+ 2
- 2
config/config.js Zobrazit soubor

230
                 },
230
                 },
231
                 {
231
                 {
232
                   path: '/channel/recommendClients',
232
                   path: '/channel/recommendClients',
233
-                  name: '推荐客户',
233
+                  name: '',
234
                   component: './channel/recommendClients',
234
                   component: './channel/recommendClients',
235
                 },
235
                 },
236
                 {
236
                 {
237
                   path: '/channel/InviteClients',
237
                   path: '/channel/InviteClients',
238
-                  name: '邀请经纪人',
238
+                  name: '',
239
                   component: './channel/InviteClients',
239
                   component: './channel/InviteClients',
240
                 },
240
                 },
241
               ],
241
               ],

+ 21
- 21
src/pages/channel/InviteClients.jsx Zobrazit soubor

11
   console.log(`selected ${value}`);
11
   console.log(`selected ${value}`);
12
 }
12
 }
13
 
13
 
14
-const dataSource = [
15
-  {
16
-    key: '1',
17
-    img: 'http://img0.imgtn.bdimg.com/it/u=4246326797,2657995307&fm=26&gp=0.jpg',
18
-    name: '123',
19
-    age: 32,
20
-    address: '西湖区湖底公园1号',
21
-  },
22
-  {
23
-    key: '2',
24
-    img: '',
25
-    age: 42,
26
-    address: '西湖区湖底公园1号',
27
-  },
28
-];
14
+// const dataSource = [
15
+//   {
16
+//     key: '1',
17
+//     img: 'http://img0.imgtn.bdimg.com/it/u=4246326797,2657995307&fm=26&gp=0.jpg',
18
+//     name: '123',
19
+//     age: 32,
20
+//     address: '西湖区湖底公园1号',
21
+//   },
22
+//   {
23
+//     key: '2',
24
+//     img: '',
25
+//     age: 42,
26
+//     address: '西湖区湖底公园1号',
27
+//   },
28
+// ];
29
 
29
 
30
 const columns = [
30
 const columns = [
31
   {
31
   {
34
     key: 'img',
34
     key: 'img',
35
     align: 'center',
35
     align: 'center',
36
 
36
 
37
-    render: (text, record) => <img src={record.img} className={channels.touxiang} />,
37
+    render: (text, record) => <img src={record.avatarurl} className={channels.touxiang} />,
38
   },
38
   },
39
   {
39
   {
40
     title: '用户姓名',
40
     title: '用户姓名',
45
   },
45
   },
46
   {
46
   {
47
     title: '电话',
47
     title: '电话',
48
-    dataIndex: 'integral',
49
-    key: 'integral',
48
+    dataIndex: 'tel',
49
+    key: 'tel',
50
     align: 'center',
50
     align: 'center',
51
   },
51
   },
52
   {
52
   {
53
     title: '性别',
53
     title: '性别',
54
-    dataIndex: 'total',
55
-    key: 'total',
54
+    dataIndex: 'sex',
55
+    key: 'sex',
56
     align: 'center',
56
     align: 'center',
57
   },
57
   },
58
 ];
58
 ];
61
   const [data, setData] = useState({ channelNmae: [], result: [] })
61
   const [data, setData] = useState({ channelNmae: [], result: [] })
62
   // eslint-disable-next-line react-hooks/rules-of-hooks
62
   // eslint-disable-next-line react-hooks/rules-of-hooks
63
   useEffect(() => {
63
   useEffect(() => {
64
-    getList({ pageNum: 1, pageSize: 10 })
64
+    getList({ id: props.location.query.id, pageNum: 1, pageSize: 10 })
65
   }, [])
65
   }, [])
66
 
66
 
67
   function getList(params) {
67
   function getList(params) {

+ 23
- 10
src/pages/channel/brokerList.jsx Zobrazit soubor

51
     align: 'center',
51
     align: 'center',
52
 
52
 
53
     // eslint-disable-next-line jsx-a11y/alt-text
53
     // eslint-disable-next-line jsx-a11y/alt-text
54
-    render: (text, record) => <img src={record.avatarurl }/>,
54
+    render: (text, list) => <img src={list.avatarurl }/>,
55
   },
55
   },
56
   {
56
   {
57
     title: '用户姓名',
57
     title: '用户姓名',
76
     dataIndex: 'recommendCount',
76
     dataIndex: 'recommendCount',
77
     key: 'recommendCount',
77
     key: 'recommendCount',
78
     align: 'center',
78
     align: 'center',
79
+    render: (text, list) => <a style={ { color: '#66B3FF' } } onClick= {() => torecommend(list.personId)} >{ list.recommendCount }</a>,
79
   },
80
   },
80
   {
81
   {
81
     title: '邀请经纪人',
82
     title: '邀请经纪人',
82
-    dataIndex: 'rest',
83
-    key: 'rest',
83
+    dataIndex: 'inviteCount',
84
+    key: 'inviteCount',
84
     align: 'center',
85
     align: 'center',
86
+    render: (text, list) => <a style={ { color: '#66B3FF' } } onClick= {() => toinvite(list.personId)} >{ list.inviteCount }</a>,
85
   },
87
   },
86
 ];
88
 ];
87
 
89
 
88
-// 跳转到编辑商品
89
-function toEditGoods() {
90
+// 跳转到推荐客户
91
+function torecommend(personId) {
90
   router.push({
92
   router.push({
91
-    pathname: '/channel/addChannel',
93
+    pathname: '/channel/recommendClients',
92
     query: {
94
     query: {
93
-      a: 'b',
95
+      id: personId,
94
     },
96
     },
95
   });
97
   });
96
 }
98
 }
97
 
99
 
100
+// 跳转到邀请经纪人
101
+function toinvite(personId) {
102
+  router.push({
103
+    pathname: '/channel/InviteClients',
104
+    query: {
105
+      id: personId,
106
+    },
107
+  });
108
+}
109
+
110
+
98
 const header = props => {
111
 const header = props => {
99
   // eslint-disable-next-line react-hooks/rules-of-hooks
112
   // eslint-disable-next-line react-hooks/rules-of-hooks
100
-  const [data, setData] = useState({})
113
+  const [data, setData] = useState({ list: [] })
101
 
114
 
102
   // eslint-disable-next-line react-hooks/rules-of-hooks
115
   // eslint-disable-next-line react-hooks/rules-of-hooks
103
   const [queryData, setQueryData] = useState({})
116
   const [queryData, setQueryData] = useState({})
164
         <Input onChange = { onInputChangeName } style ={{ width: 150 }} />
177
         <Input onChange = { onInputChangeName } style ={{ width: 150 }} />
165
       </div>
178
       </div>
166
       <div>
179
       <div>
167
-      <Button type="primary"  onClick={() => queryList() }>查询</Button>
180
+      <Button type="primary" onClick={() => queryList() }>查询</Button>
168
       <Button onClick={() => refurbishList() }>重置</Button>
181
       <Button onClick={() => refurbishList() }>重置</Button>
169
     </div>
182
     </div>
170
     </div>
183
     </div>
171
-    <Table dataSource={data.records} columns={columns} pagination={{ pageSize: 10, total: data.total, onChange }} />
184
+    <Table dataSource={data.list} columns={columns} pagination={{ pageSize: 10, total: data.total, onChange }} />
172
   </>
185
   </>
173
 )
186
 )
174
 }
187
 }