Преглед изворни кода

Merge branch 'master' of http://git.ycjcjy.com/zhiyuxing/estateagents-admin-manager

许静 пре 5 година
родитељ
комит
bef76ec060

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

@@ -134,6 +134,38 @@ export default {
134 134
                 },
135 135
               ],
136 136
             },
137
+            {
138
+              path: '/customer',
139
+              name: '客户管理',
140
+              component: '../layouts/BlankLayout',
141
+              routes: [
142
+                {
143
+                  path: '/customer/drift/list',
144
+                  name: '游客列表',
145
+                  component: './customer/drift/index',
146
+                },
147
+                {
148
+                  path: '/customer/report/list',
149
+                  name: '报备客户',
150
+                  component: './customer/report/index',
151
+                },
152
+                {
153
+                  path: '/customer/recommendCustomer/list',
154
+                  name: '推荐客户',
155
+                  component: './customer/recommendCustomer/index',
156
+                },
157
+                {
158
+                  path: '/customer/recommendCustomer/audit',
159
+                  name: '', //审核
160
+                  component: './customer/recommendCustomer/audit',
161
+                },
162
+                {
163
+                  path: '/customer/independentList',
164
+                  name: '经济人',
165
+                  component: './customer/independentList/index',
166
+                },
167
+              ],
168
+            },
137 169
             {
138 170
               path: '/integralMall',
139 171
               name: '积分商城',

+ 2
- 1
package.json Прегледај датотеку

@@ -60,7 +60,8 @@
60 60
     "umi": "^2.8.7",
61 61
     "umi-plugin-pro-block": "^1.3.2",
62 62
     "umi-plugin-react": "^1.9.5",
63
-    "umi-request": "^1.0.8"
63
+    "umi-request": "^1.0.8",
64
+    "wangeditor": "^3.1.1"
64 65
   },
65 66
   "devDependencies": {
66 67
     "@ant-design/colors": "^3.1.0",

+ 40
- 0
src/components/SelectButton/BuildSelect.jsx Прегледај датотеку

@@ -0,0 +1,40 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Select } from 'antd';
3
+
4
+import request from '../../utils/request'
5
+
6
+const { Option } = Select;
7
+
8
+/**
9
+ *
10
+ *
11
+ * @param {*} props
12
+ * @returns
13
+ */
14
+const BuildingSelect = (props) => {
15
+  const [ data, setData ] = useState([])
16
+
17
+  useEffect(() => {
18
+    getCityList();
19
+  },[])
20
+
21
+  const getCityList = (e) => {
22
+    request({
23
+        url: '/api/admin/buildinglist/select',
24
+        method: 'GET',
25
+        params: {pageNum: 1,pageSize: 999},
26
+    }).then((data) => {
27
+        setData(data.records)
28
+    })
29
+  }
30
+
31
+  return (
32
+      <Select value={props.value} style={{ width: '180px' }} placeholder="请选择项目" onChange={props.onChange}>
33
+          {data.map(building => (
34
+            <Option key={building.buildingId}>{building.buildingName}</Option>
35
+          ))}
36
+      </Select>
37
+  )
38
+}
39
+export default BuildingSelect
40
+

+ 4
- 4
src/components/SelectButton/CitySelect.jsx Прегледај датотеку

@@ -20,18 +20,18 @@ const CitySelect = (props) => {
20 20
 
21 21
   const getCityList = (e) => {
22 22
     request({
23
-        url: '/api/admin/buildinglist/select',
23
+        url: '/api/admin/tdCity',
24 24
         method: 'GET',
25
-        params: {pageNum: 1,pageSize: 999},
25
+        params: {leveltype: 2, pageNum: 1,pageSize: 999},
26 26
     }).then((data) => {
27
-        setData(data.records)
27
+        setData(data)
28 28
     })
29 29
   }
30 30
 
31 31
   return (
32 32
       <Select value={props.value} style={{ width: '180px' }} placeholder="请选择城市" onChange={props.onChange}>
33 33
           {data.map(city => (
34
-            <Option key={city.buildingId}>{city.buildingName}</Option>
34
+            <Option key={city.id}>{city.name}</Option>
35 35
           ))}
36 36
       </Select>
37 37
   )

+ 34
- 0
src/components/Wangedit/Wangedit.jsx Прегледај датотеку

@@ -0,0 +1,34 @@
1
+import React from 'react';
2
+import E from 'wangeditor'
3
+
4
+/**
5
+ *
6
+ *
7
+ * @param {*} props
8
+ * @returns
9
+ */
10
+class Wangedit extends React.Component {
11
+  constructor(props, context) {
12
+    super(props, context);
13
+    this.state = {}
14
+  }
15
+
16
+  render () {
17
+    return (
18
+      <div ref="editorElem" style={{textAlign: 'left'}}>
19
+      </div>
20
+    );
21
+  }
22
+
23
+  componentDidMount () {
24
+    const elem = this.refs.editorElem
25
+    const editor = new E(elem)
26
+    // 使用 onchange 函数监听内容的变化
27
+    editor.customConfig.onchange = this.props.onChange
28
+    editor.create()
29
+    editor.txt.html(this.props.value)
30
+  }
31
+}
32
+
33
+export default Wangedit
34
+

+ 192
- 191
src/pages/activity/ActivityList.jsx Прегледај датотеку

@@ -5,228 +5,226 @@ import styles from '../style/GoodsList.less';
5 5
 import router from 'umi/router';
6 6
 import moment from 'moment';
7 7
 import SelectCity from '../../components/SelectButton/CitySelect'
8
+import BuildSelect from '../../components/SelectButton/BuildSelect'
8 9
 
9 10
 import request from '../../utils/request'
10 11
 
11 12
 const { Option } = Select;
12 13
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
13
-// 提交事件
14
-function handleSubmit(e, props) {
15
-  e.preventDefault();
16
-  props.form.validateFields((err, values) => {
17
-    if (!err) {
18
-      console.log('提交数据: ', values)
19
-    }
20
-  });
21
-}
22
-// Change 事件
23
-function handleSelectChange(props) {
24
-  console.log(props)
25
-}
26
-
27
-// 分页
28
-function onChange(pageNumber) {
29
-  console.log('Page: ', pageNumber);
30
-}
31
-// 跳转到编辑商品
32
-function toEditGoods() {
33
-  router.push({
34
-    pathname: '/activity/editActivity',
35
-    query: {
36
-      a: 'b',
37
-    },
38
-  });
39
-}
40
-
41
-/**
42
- *
43
- *
44
- * @param {*} props
45
- * @returns
46
- */
47
-
48
-const columns = [
49
-  {
50
-    title: '活动标题',
51
-    dataIndex: 'title',
52
-    key: 'title',
53
-    align: 'center',
54
-  },
55
-  {
56
-    title: '活动时间',
57
-    dataIndex: 'startDate',
58
-    key: 'startDate',
59
-    align: 'center',
60
-    render: (x, row) => <><span>{`${moment(row.startDate).format('YYYY-MM-DD')} —— ${moment(row.endDate).format('YYYY-MM-DD')}`}</span></>
61
-  },
62
-  {
63
-    title: '已参加人数',
64
-    dataIndex: 'count',
65
-    key: 'count',
66
-    align: 'center',
67
-  },
68
-  {
69
-    title: '阅读量',
70
-    dataIndex: 'pvNum',
71
-    key: 'pvNum',
72
-    align: 'center',
73
-  },
74
-  {
75
-    title: '转发量',
76
-    dataIndex: 'shareNum',
77
-    key: 'shareNum',
78
-    align: 'center',
79
-  },
80
-  {
81
-    title: '收藏数',
82
-    dataIndex: 'saveNum',
83
-    key: 'saveNum',
84
-    align: 'center',
85
-  },
86
-  {
87
-    title: '状态',
88
-    dataIndex: 'isEnlist',
89
-    key: 'isEnlist',
90
-    align: 'center',
91
-    render: (isEnlist)=> <><span>{isEnlist == 0 ?"未开始" : isEnlist==1 ? "进行中" : "已结束"}</span></>
92
-  },
93
-  {
94
-    title: '操作',
95
-    dataIndex: 'handle',
96
-    key: 'handle',
97
-    align: 'center',
98
-    render: (x,row) => <><span style={{ color: '#1990FF'}} onClick={getSignList.bind(this, row.dynamicId)}>{row.isEnlist == '1' || row.isEnlist == '2' ? "报名记录" : ""}<Icon type="snippets" className={styles.shoppingCart} /></span>
99
-                         <span style={{ color: '#1990FF' }} onClick={sendOrPublicDynamic.bind(this,row)}>{ row.status === 1 ? '取消发布' : '发布' }<Icon type="close-circle" className={styles.edit} /></span>
100
-                         <span style={{ color: '#1990FF' }} onClick={finishDynamic.bind(this,row)}>结束活动<Icon type="poweroff" className={styles.edit} /></span>
101
-                         <span style={{ color: '#1990FF', marginRight: '20px' }} onClick={topDynamic.bind(this,row)}>{ row.weight === 1 ? '取消置顶' : '置顶' }<Icon type="vertical-align-top" className={styles.edit} /></span>
102
-                         <span style={{ color: '#FF925C' }}>编辑<Icon type="form" className={styles.edit} /></span>
103
-                       </>
104
-  },
105
-];
106
-
107
-const getSignList = (dynamicId) => {
108
-    router.push({
109
-        pathname: '/activity/SignList',
110
-        query: {
111
-            dynamicId
112
-        },
113
-      });
114
-}
115
-
116
-const finishDynamic = (row) => {
117
-    Modal.confirm({
118
-        title: '结束以后将无法编辑, 是否继续?',
119
-        okText: '确定',
120
-        cancelText: '取消',
121
-        onOk() {
122
-            request({
123
-                url: '/api/admin/buildingDynamic/finish',
124
-                method: 'PUT',
125
-                data: {dynamicId: row.dynamicId, top: ""},
126
-            }).then((data) => {
127
-                console.log(data)
128
-                message.info('操作成功!')
129
-                // getList()
130
-            }).catch((err) => {
131
-                console.log(err)
132
-                message.info(err.msg || err.message)
133
-            })
134
-        },
135
-      });
136
-}
137
-
138
-const topDynamic = (row) => {
139
-    const weight = Math.abs(row.weight - 1)
140
-    request({
141
-        url: '/api/admin/buildingDynamic/weight',
142
-        method: 'PUT',
143
-        params: {dynamicId: row.dynamicId, weight},
144
-    }).then((data) => {
145
-        console.log(data)
146
-        message.info('操作成功!')
147
-        // getList()
148
-    }).catch((err) => {
149
-        console.log(err)
150
-        message.info(err.msg || err.message)
151
-    })
152
-}
153
-
154
-const sendOrPublicDynamic = (row) => {
155
-    if (row.status === 1) {
156
-        cancelDynamic(row)
157
-    } else {
158
-        sendDynamic(row)
159
-    }
160
-}
161
-
162
-// 取消活动
163
-const cancelDynamic = (row) => {
164
-    request({
165
-        url: '/api/admin/buildingDynamic/cancel/'+row.dynamicId,
166
-        method: 'PUT',
167
-    }).then((data) => {
168
-        message.info('操作成功!')
169
-        // getList()
170
-    }).catch((err) => {
171
-        console.log(err)
172
-        message.info(err.msg || err.message)
173
-    })
174
-}
175
-
176
-//发布活动
177
-const sendDynamic = (row) => {
178
-    request({
179
-        url: '/api/admin/buildingDynamic/send/'+row.dynamicId,
180
-        method: 'PUT',
181
-    }).then((data) => {
182
-        message.info('操作成功!')
183
-        // getList()
184
-    }).catch((err) => {
185
-        console.log(err)
186
-        message.info(err.msg || err.message)
187
-    })
188
-}
189 14
 
190 15
 const header = (props) => {
191 16
   const [ data, setData ] = useState({})
192 17
 //   const [page, changePage] = useState({})
193 18
 
194 19
   useEffect(() => {
195
-    getList();
20
+    getList({ pageNum: 1, pageSize: 10 });
196 21
   },[])
197 22
 
198 23
   // 查询列表
199
-  const getList = (e) => {
24
+  const getList = (params) => {
200 25
     request({
201 26
         url: '/api/admin/iBuildingDynamicList',
202 27
         method: 'GET',
203
-        params: {pageNum: 1,pageSize: 10},
28
+        params: { ...params },
204 29
     }).then((data) => {
205 30
         console.log(data)
206 31
         setData(data)
207 32
     })
208 33
   }
209 34
 
35
+  
36
+// 跳转到编辑商品
37
+const toEditGoods = (dynamicId) => () => {
38
+    router.push({
39
+      pathname: '/activity/editActivity',
40
+      query: {
41
+        dynamicId
42
+      },
43
+    });
44
+  }
45
+  
46
+  /**
47
+   *
48
+   *
49
+   * @param {*} props
50
+   * @returns
51
+   */
52
+  
53
+  const columns = [
54
+    {
55
+      title: '活动标题',
56
+      dataIndex: 'title',
57
+      key: 'title',
58
+      align: 'center',
59
+    },
60
+    {
61
+      title: '活动时间',
62
+      dataIndex: 'startDate',
63
+      key: 'startDate',
64
+      align: 'center',
65
+      render: (x, row) => <><span>{`${moment(row.startDate).format('YYYY-MM-DD')} —— ${moment(row.endDate).format('YYYY-MM-DD')}`}</span></>
66
+    },
67
+    {
68
+      title: '已参加人数',
69
+      dataIndex: 'count',
70
+      key: 'count',
71
+      align: 'center',
72
+    },
73
+    {
74
+      title: '阅读量',
75
+      dataIndex: 'pvNum',
76
+      key: 'pvNum',
77
+      align: 'center',
78
+    },
79
+    {
80
+      title: '转发量',
81
+      dataIndex: 'shareNum',
82
+      key: 'shareNum',
83
+      align: 'center',
84
+    },
85
+    {
86
+      title: '收藏数',
87
+      dataIndex: 'saveNum',
88
+      key: 'saveNum',
89
+      align: 'center',
90
+    },
91
+    {
92
+      title: '状态',
93
+      dataIndex: 'isEnlist',
94
+      key: 'isEnlist',
95
+      align: 'center',
96
+      render: (isEnlist)=> <><span>{isEnlist == 0 ?"未开始" : isEnlist==1 ? "进行中" : "已结束"}</span></>
97
+    },
98
+    {
99
+      title: '操作',
100
+      dataIndex: 'handle',
101
+      key: 'handle',
102
+      align: 'center',
103
+      render: (x,row) => <><span style={{ color: '#1990FF'}} onClick={getSignList.bind(this, row.dynamicId)}>{row.isEnlist == '1' || row.isEnlist == '2' ? "报名记录" : ""}<Icon type="snippets" className={styles.shoppingCart} /></span>
104
+                           <span style={{ color: '#1990FF' }} onClick={sendOrPublicDynamic.bind(this,row)}>{ row.status === 1 ? '取消发布' : '发布' }<Icon type="close-circle" className={styles.edit} /></span>
105
+                           <span style={{ color: '#1990FF' }} onClick={finishDynamic.bind(this,row)}>结束活动<Icon type="poweroff" className={styles.edit} /></span>
106
+                           <span style={{ color: '#1990FF', marginRight: '20px' }} onClick={topDynamic(row)}>{ row.weight === 1 ? '取消置顶' : '置顶' }<Icon type="vertical-align-top" className={styles.edit} /></span>
107
+                           <span style={{ color: '#FF925C' }} onClick={toEditGoods(row.dynamicId)}>编辑<Icon type="form" className={styles.edit} /></span>
108
+                         </>
109
+    },
110
+  ];
111
+  
112
+  const getSignList = (dynamicId) => {
113
+      router.push({
114
+          pathname: '/activity/SignList',
115
+          query: {
116
+              dynamicId
117
+          },
118
+        });
119
+  }
120
+  
121
+  const finishDynamic = (row) => {
122
+      Modal.confirm({
123
+          title: '结束以后将无法编辑, 是否继续?',
124
+          okText: '确定',
125
+          cancelText: '取消',
126
+          onOk() {
127
+              request({
128
+                  url: '/api/admin/buildingDynamic/finish',
129
+                  method: 'PUT',
130
+                  data: {dynamicId: row.dynamicId, top: ""},
131
+              }).then((data) => {
132
+                  console.log(data)
133
+                  message.info('操作成功!')
134
+                  getList({ pageNum: 1, pageSize: 10 })
135
+              }).catch((err) => {
136
+                  console.log(err)
137
+                  message.info(err.msg || err.message)
138
+              })
139
+          },
140
+        });
141
+  }
142
+  
143
+//   置顶
144
+  const topDynamic = (row) => () => {
145
+      const weight = Math.abs(row.weight - 1)
146
+      request({
147
+          url: '/api/admin/buildingDynamic/weight',
148
+          method: 'PUT',
149
+          params: {dynamicId: row.dynamicId, weight},
150
+      }).then((data) => {
151
+          console.log(data)
152
+          message.info('操作成功!')
153
+          getList({ pageNum: 1, pageSize: 10 })
154
+      }).catch((err) => {
155
+          console.log(err)
156
+          message.info(err.msg || err.message)
157
+      })
158
+  }
159
+  
160
+  const sendOrPublicDynamic = (row) => {
161
+      if (row.status === 1) {
162
+          cancelDynamic(row)
163
+      } else {
164
+          sendDynamic(row)
165
+      }
166
+  }
167
+  
168
+  // 取消活动
169
+  const cancelDynamic = (row) => {
170
+      request({
171
+          url: '/api/admin/buildingDynamic/cancel/'+row.dynamicId,
172
+          method: 'PUT',
173
+      }).then((data) => {
174
+          message.info('操作成功!')
175
+          getList({ pageNum: 1, pageSize: 10 })
176
+      }).catch((err) => {
177
+          console.log(err)
178
+          message.info(err.msg || err.message)
179
+      })
180
+  }
181
+  
182
+  //发布活动
183
+  const sendDynamic = (row) => {
184
+      request({
185
+          url: '/api/admin/buildingDynamic/send/'+row.dynamicId,
186
+          method: 'PUT',
187
+      }).then((data) => {
188
+          message.info('操作成功!')
189
+          getList({ pageNum: 1, pageSize: 10 });
190
+      }).catch((err) => {
191
+          console.log(err)
192
+          message.info(err.msg || err.message)
193
+      })
194
+  }
195
+  
196
+  const changePageNum = (pageNumber) => {
197
+      getList({ pageNum: pageNumber, pageSize: 10 })
198
+  }
199
+
200
+  // 提交事件
201
+const handleSubmit = (e, props) => {
202
+    e.preventDefault();
203
+    props.form.validateFields((err, values) => {
204
+      if (!err) {
205
+        console.log('提交数据: ', values)
206
+        getList({ pageNum: 1, pageSize: 10, ...values })
207
+      }
208
+    });
209
+  }
210
+
210 211
   const { getFieldDecorator } = props.form
211 212
   return (
212 213
 
213 214
     <>
214 215
       <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
215 216
         <Form.Item>
216
-          {getFieldDecorator('goodState')(
217
+          {getFieldDecorator('cityId')(
217 218
             <SelectCity />,
218 219
           )}
219 220
         </Form.Item>
220 221
         <Form.Item>
221
-          {getFieldDecorator('isMain')(
222
-            <Select style={{ width: '180px' }} placeholder="请选择项目" onChange={handleSelectChange}>
223
-              <Option value="1">首页推荐</Option>
224
-              <Option value="0">首页未推荐</Option>
225
-            </Select>,
222
+          {getFieldDecorator('buildingId')(
223
+            <BuildSelect />,
226 224
           )}
227 225
         </Form.Item>
228 226
         <Form.Item>
229
-          {getFieldDecorator('name')(
227
+          {getFieldDecorator('title')(
230 228
             <Input
231 229
               prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
232 230
               placeholder="请输入标题"
@@ -234,13 +232,13 @@ const header = (props) => {
234 232
           )}
235 233
         </Form.Item>
236 234
         <Form.Item>
237
-          {getFieldDecorator('min')(
235
+          {getFieldDecorator('time')(
238 236
             <DatePicker />
239 237
           )}
240 238
         </Form.Item>
241 239
         <Form.Item>
242
-          {getFieldDecorator('goodState')(
243
-            <Select style={{ width: '180px' }} placeholder="是否报名" onChange={handleSelectChange}>
240
+          {getFieldDecorator('isEnlist')(
241
+            <Select style={{ width: '180px' }} placeholder="是否报名">
244 242
               <Option value="1">已报名</Option>
245 243
               <Option value="0">未报名</Option>
246 244
             </Select>,
@@ -252,8 +250,11 @@ const header = (props) => {
252 250
           </Button>
253 251
         </Form.Item>
254 252
       </Form>
255
-      <Button type="primary" className={styles.addBtn} onClick={toEditGoods}>新增</Button>
256
-      <Table dataSource={data.list} columns={columns} />
253
+      <Button type="primary" className={styles.addBtn} onClick={toEditGoods()}>新增</Button>
254
+      <Table dataSource={data.list} columns={columns} pagination={false}/>
255
+      <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
256
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} />
257
+      </div>
257 258
     </>
258 259
   )
259 260
 }

+ 29
- 24
src/pages/activity/SignList.jsx Прегледај датотеку

@@ -10,14 +10,6 @@ import request from '../../utils/request'
10 10
 const { Option } = Select;
11 11
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
12 12
 
13
-
14
-
15
-// 分页
16
-function onChange(pageNumber) {
17
-  console.log('Page: ', pageNumber);
18
-}
19
-
20
-
21 13
 /**
22 14
  *
23 15
  *
@@ -27,51 +19,64 @@ function onChange(pageNumber) {
27 19
 
28 20
 const columns = [
29 21
   {
30
-    title: '活动标题',
31
-    dataIndex: 'title',
32
-    key: 'title',
22
+    title: '用户姓名',
23
+    dataIndex: 'name',
24
+    key: 'name',
33 25
     align: 'center',
34 26
   },
35 27
   {
36
-    title: '活动时间',
37
-    dataIndex: 'startDate',
38
-    key: 'startDate',
28
+    title: '手机号',
29
+    dataIndex: 'phone',
30
+    key: 'phone',
39 31
     align: 'center',
40
-    render: (x, row) => <><span>{`${moment(row.startDate).format('YYYY-MM-DD')} —— ${moment(row.endDate).format('YYYY-MM-DD')}`}</span></>
41 32
   },
42 33
   {
43
-    title: '已参加人数',
44
-    dataIndex: 'count',
45
-    key: 'count',
34
+    title: '报名时间',
35
+    dataIndex: 'createDate',
36
+    key: 'createDate',
46 37
     align: 'center',
38
+    render: (x, row) => <><span>{`${moment(row.createDate).format('YYYY-MM-DD')}`}</span></>
47 39
   }
48 40
 ];
49 41
 
50 42
 
51 43
 
52 44
 const header = (props) => {
53
-  const [ data, setData ] = useState({})
45
+  const [ data, setData ] = useState({list: {}})
54 46
 //   const [page, changePage] = useState({})
55 47
   useEffect(() => {
56
-    getSignList();
48
+    getSignList({pageNum: 1,pageSize: 10, dynamicId: props.location.query.dynamicId });
57 49
   },[])
58 50
 
59 51
   // 查询列表
60
-  const getSignList = (e) => {
52
+  const getSignList = (params) => {
61 53
     request({
62 54
         url: '/api/admin/SignList',
63 55
         method: 'GET',
64
-        params: {pageNum: 1,pageSize: 10, dynamicId: props.location.query.dynamicId },
56
+        params: { ...params },
65 57
     }).then((data) => {
66 58
         console.log(data)
67 59
         setData(data)
68 60
     })
69 61
   }
70 62
 
63
+  const changePageNum = (pageNumber) => {
64
+    getList({ pageNum: pageNumber, pageSize: 10, dynamicId: props.location.query.dynamicId })
65
+  }
66
+
67
+  const toActivityList = () => {
68
+    router.push({
69
+      pathname: '/activity/ActivityList',
70
+    });
71
+  }
72
+
71 73
   return (
72 74
     <>
73
-      <Button type="primary" className={styles.addBtn}>返回</Button>
74
-      <Table dataSource={data} columns={columns} />
75
+      <Button type="primary" className={styles.addBtn} onClick={toActivityList}>返回</Button>
76
+      <Table dataSource={data.list.data} columns={columns} pagination={false} />
77
+      <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
78
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} />
79
+      </div>
75 80
     </>
76 81
   )
77 82
 }

+ 79
- 23
src/pages/activity/editActivity.jsx Прегледај датотеку

@@ -2,8 +2,8 @@ import React, { useState } from 'react';
2 2
 import { Form, Input, Button, Icon, Select, Tabs, Radio } from 'antd';
3 3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4 4
 import styles from '../style/GoodsList.less';
5
-
6
-
5
+import XForm, { FieldTypes } from '../../components/XForm';
6
+import Wangedit from '../../components/Wangedit/Wangedit'
7 7
 
8 8
 /**
9 9
  *
@@ -11,37 +11,93 @@ import styles from '../style/GoodsList.less';
11 11
  * @param {*} props
12 12
  * @returns
13 13
  */
14
-
15
-
16
- const Basic = (props) => {
17
-   return <div>Basic</div>
18
- }
19
- 
20
- const Poster = (props) => {
21
-  return <div>Poster</div>
22
-}
23
-
24
-const Share = (props) => {
25
-  return <div>Share</div>
26
-}
27
-
28 14
  const Edit = (props) => {
29
-   const [ tab, changeTab ] = useState('a');
15
+  const [ tab, changeTab ] = useState('basic');
16
+  const dynamicId = props.location.query.dynamicId
17
+  console.log(dynamicId)
30 18
 
19
+  const Basic = (props) => {
20
+    const fields = [
21
+      {
22
+        label: '所属项目',
23
+        name: 'org_id',
24
+        type: FieldTypes.Text
25
+      },
26
+      {
27
+        label: '主图',
28
+        name: 'city_id',
29
+        type: FieldTypes.ImageUploader,
30
+      },
31
+      {
32
+        label: '活动标题',
33
+        name: 'share_num',
34
+        type: FieldTypes.Text,
35
+        placeholder: '不填, 默认使用手机号'
36
+      },
37
+      {
38
+        label: '活动时间',
39
+        name: 'save_num',
40
+        type: FieldTypes.Text,
41
+        rules: [
42
+          {required: true, message: '请填写手机号'}
43
+        ]
44
+      },
45
+      {
46
+        label: '活动地点',
47
+        name: 'pv_num',
48
+        type: FieldTypes.ImageUploader,
49
+        extra: '建议图片大小 128 * 128'
50
+      },
51
+      {
52
+        label: '活动人数',
53
+        name: 'favor_num',
54
+        type: FieldTypes.DatePicker,
55
+      },
56
+      {
57
+        label: '活动详情',
58
+        name: 'expDate',
59
+        render: <Wangedit />,
60
+        value: "222222",
61
+      },
62
+      {
63
+        label: '是否需要报名',
64
+        name: 'volume_rate',
65
+        type: FieldTypes.DatePicker,
66
+      },
67
+      {
68
+        label: '报名时间',
69
+        name: 'parking_rate',
70
+        type: FieldTypes.DatePicker,
71
+      },
72
+    ]
73
+  
74
+    const handleSubmit = val => {
75
+      window.console.log('submit data --->', val)
76
+    }
77
+    return <XForm onSubmit={handleSubmit} fields={fields}></XForm>
78
+  }
79
+  
80
+  const Poster = (props) => {
81
+   return <div>Poster</div>
82
+  }
83
+ 
84
+  const Share = (props) => {
85
+    return <div>Share</div>
86
+  }
31 87
 
32 88
   return (
33 89
     <div>
34 90
       <div>
35 91
         <Radio.Group value={tab} buttonStyle="solid" onChange={e => changeTab(e.target.value)}>
36
-          <Radio.Button value="a">基本信息</Radio.Button>
37
-          <Radio.Button value="b">海报图片</Radio.Button>
38
-          <Radio.Button value="c">分享设置</Radio.Button>
92
+          <Radio.Button value="basic">基本信息</Radio.Button>
93
+          <Radio.Button value="poster">海报图片</Radio.Button>
94
+          <Radio.Button value="share">分享设置</Radio.Button>
39 95
         </Radio.Group>
40 96
       </div>
41 97
       <div>
42
-        { tab === 'a' && <Basic /> }
43
-        { tab === 'b' && <Poster /> }
44
-        { tab === 'c' && <Share /> }
98
+        { tab === 'basic' && <Basic /> }
99
+        { tab === 'poster' && <Poster /> }
100
+        { tab === 'share' && <Share /> }
45 101
       </div>
46 102
     </div>
47 103
   );

+ 47
- 25
src/pages/channel/addChannel.jsx Прегледај датотеку

@@ -1,37 +1,64 @@
1
-import React from 'react';
2
-import { Form, Select, Input, Button } from 'antd';
1
+import React, { useState, useEffect } from 'react';
2
+import { Input, Menu, Dropdown, Button, Icon, message, Table, Divider, Tag, Select, Form, Alert } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
3 4
 import channels from './channelList.less';
5
+import router from 'umi/router';
6
+import request from '../../utils/request'
4 7
 
5 8
 const { TextArea } = Input;
6 9
 const { Option } = Select;
7 10
 
8
-class App extends React.Component {
9
-  handleSubmit = e => {
11
+const header = props => {
12
+  // eslint-disable-next-line react-hooks/rules-of-hooks
13
+  const [data, setData] = useState({ channelNmae: [], result: [] })
14
+  // eslint-disable-next-line react-hooks/rules-of-hooks
15
+
16
+  // useEffect(() => {
17
+  //   addChannel({ pageNum: 1, pageSize: 10 })
18
+  // }, [])
19
+
20
+  function addChannel(params) {
21
+      request({
22
+        url: '/api/admin/channel',
23
+        method: 'POST',
24
+        data: { ...params },
25
+    // eslint-disable-next-line no-shadow
26
+    }).then(data => {
27
+        console.log(data)
28
+        setData(data)
29
+         // eslint-disable-next-line no-unused-expressions
30
+         router.go(-1)
31
+    })
32
+  }
33
+
34
+  function handleSubmit(e) {
10 35
     e.preventDefault();
11
-    this.props.form.validateFields((err, values) => {
12
-      console.log('Form.Item', values.note)
36
+    props.form.validateFields((err, values) => {
13 37
       if (!err) {
14
-       alert('Received values of form: ', values);
38
+        console.log('Received values of form: ', values);
39
+        // eslint-disable-next-line max-len
40
+        addChannel({ channelName: values.channelName, channelContact: values.channelContact, contactTel: values.contactTel })
15 41
       }
16 42
     });
17
-  };
43
+  }
44
+
45
+  const { getFieldDecorator } = props.form;
18 46
 
19
-  render() {
20
-    const { getFieldDecorator } = this.props.form;
21
-    return (
22
-      <Form labelCol={{ span: 7 }} wrapperCol={{ span: 12 }} onSubmit={this.handleSubmit}>
47
+  return (
48
+  <>
49
+        <Form labelCol={{ span: 7 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
23 50
         <Form.Item label="渠道名称">
24
-          {getFieldDecorator('note', {
51
+          {getFieldDecorator('channelName', {
25 52
             rules: [{ required: true, message: '请输入渠道名称' }],
26 53
           })(<Input className={channels.inpuit} / >)}
27 54
         </Form.Item>
28 55
         <Form.Item label="联系人">
29
-          {getFieldDecorator('note2', {
56
+          {getFieldDecorator('channelContact', {
30 57
             rules: [{ required: true, message: ' 请输入联系人' }],
31 58
           })(<Input className={channels.inpuit} />)}
32 59
         </Form.Item>
33 60
         <Form.Item label="联系电话">
34
-          {getFieldDecorator('note3', {
61
+          {getFieldDecorator('contactTel', {
35 62
             rules: [{ required: true, message: '请输入联系电话' }],
36 63
           })(<Input className={channels.inpuit} />)}
37 64
         </Form.Item>
@@ -42,19 +69,14 @@ class App extends React.Component {
42 69
           <Button type="primary" htmlType="submit">
43 70
             保存
44 71
           </Button>
45
-          <Button className={channels.formButton} type="primary" htmlType="submit">
72
+          <Button className={channels.formButton} onClick = {() => router.go(-1)} type="primary" htmlType="submit">
46 73
             取消
47 74
           </Button>
48 75
         </Form.Item>
49 76
       </Form>
50
-    );
51
-  }
77
+  </>
78
+)
52 79
 }
53 80
 
54
-const WrappedApp = Form.create({ name: 'coordinated' })(App);
55
-
56
-export default () => (
57
-  <>
58
-    <WrappedApp />
59
-  </>
60
-);
81
+const WrappedNormalLoginForm = Form.create({ name: 'header' })(header);
82
+export default WrappedNormalLoginForm

+ 60
- 29
src/pages/channel/brokerList.jsx Прегледај датотеку

@@ -1,8 +1,9 @@
1
-import React from 'react';
1
+import React, { useState, useEffect } from 'react';
2 2
 import { Input, Menu, Dropdown, Button, Icon, message, Table, Divider, Tag, Select } from 'antd';
3 3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4 4
 import channels from './channelList.less';
5 5
 import router from 'umi/router';
6
+import request from '../../utils/request'
6 7
 
7 8
 const { Option } = Select;
8 9
 function handleChange(value) {
@@ -26,54 +27,54 @@ const menu = (
26 27
     </Menu.Item>
27 28
   </Menu>
28 29
 );
29
-const dataSource = [
30
-  {
31
-    key: '1',
32
-    img: 'http://img0.imgtn.bdimg.com/it/u=4246326797,2657995307&fm=26&gp=0.jpg',
33
-    name: '123',
34
-    age: 32,
35
-    address: '西湖区湖底公园1号',
36
-  },
37
-  {
38
-    key: '2',
39
-    img: '',
40
-    age: 42,
41
-    address: '西湖区湖底公园1号',
42
-  },
43
-];
30
+// const dataSource = [
31
+//   {
32
+//     key: '1',
33
+//     img: 'http://img0.imgtn.bdimg.com/it/u=4246326797,2657995307&fm=26&gp=0.jpg',
34
+//     name: '123',
35
+//     age: 32,
36
+//     address: '西湖区湖底公园1号',
37
+//   },
38
+//   {
39
+//     key: '2',
40
+//     img: '',
41
+//     age: 42,
42
+//     address: '西湖区湖底公园1号',
43
+//   },
44
+// ];
44 45
 
45 46
 const columns = [
46 47
   {
47 48
     title: '头像',
48
-    dataIndex: 'img',
49
-    key: 'img',
49
+    dataIndex: 'avatarurl',
50
+    key: 'avatarurl',
50 51
     align: 'center',
51 52
 
52
-    render: (text, record) => <img src={record.img} className={channels.touxiang} />,
53
+    // eslint-disable-next-line jsx-a11y/alt-text
54
+    render: (text, record) => <img src={record.avatarurl }/>,
53 55
   },
54 56
   {
55 57
     title: '用户姓名',
56 58
     dataIndex: 'name',
57 59
     key: 'name',
58 60
     align: 'center',
59
-    render: text => <a>{text}</a>,
60 61
   },
61 62
   {
62 63
     title: '电话',
63
-    dataIndex: 'integral',
64
-    key: 'integral',
64
+    dataIndex: 'tel',
65
+    key: 'tel',
65 66
     align: 'center',
66 67
   },
67 68
   {
68 69
     title: '性别',
69
-    dataIndex: 'total',
70
-    key: 'total',
70
+    dataIndex: 'sex',
71
+    key: 'sex',
71 72
     align: 'center',
72 73
   },
73 74
   {
74 75
     title: '推荐客户',
75
-    dataIndex: 'exchanged',
76
-    key: 'exchanged',
76
+    dataIndex: 'recommendCount',
77
+    key: 'recommendCount',
77 78
     align: 'center',
78 79
   },
79 80
   {
@@ -93,7 +94,35 @@ function toEditGoods() {
93 94
     },
94 95
   });
95 96
 }
96
-export default () => (
97
+const header = props => {
98
+  // eslint-disable-next-line react-hooks/rules-of-hooks
99
+  const [data, setData] = useState({})
100
+//   const [page, changePage] = useState({})
101
+  // eslint-disable-next-line react-hooks/rules-of-hooks
102
+  useEffect(() => {
103
+    request({
104
+        url: '/api/admin/channel/broker',
105
+        method: 'GET',
106
+        params: { pageNum: 1, pageSize: 10 },
107
+    // eslint-disable-next-line no-shadow
108
+    }).then(data => {
109
+        console.log(data)
110
+        setData(data)
111
+    })
112
+  }, [])
113
+
114
+  const getList = e => {
115
+    request({
116
+        url: '/api/xxx',
117
+        method: 'GET',
118
+        params: {},
119
+    // eslint-disable-next-line no-shadow
120
+    }).then(data => {
121
+        setData(data)
122
+    })
123
+  }
124
+
125
+return (
97 126
   <>
98 127
     <div className={ channels.searchBox }>
99 128
       <div>
@@ -104,11 +133,13 @@ export default () => (
104 133
       </div>
105 134
       <Button className={channels.about}>查询</Button>
106 135
     </div>
107
-    <Table dataSource={dataSource} columns={columns} />
136
+    <Table dataSource={data.records} columns={columns} />
108 137
   </>
109
-);
138
+)
139
+}
110 140
 
111 141
 function handleMenuClick(e) {
112 142
   message.info('Click on menu item.');
113 143
   console.log('click', e);
114 144
 }
145
+export default header

+ 96
- 77
src/pages/channel/channelList.jsx Прегледај датотеку

@@ -1,46 +1,27 @@
1
-import React from 'react';
1
+import React, { useState, useEffect } from 'react';
2 2
 import { Input, Menu, Dropdown, Button, Icon, message, Table, Divider, Tag, Select } from 'antd';
3 3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4 4
 import channels from './channelList.less';
5 5
 import router from 'umi/router';
6
+import request from '../../utils/request'
6 7
 
7 8
 const { Option } = Select;
8
-function handleChange(value) {
9
-  console.log(`selected ${value}`);
10
-}
11
-
12 9
 
13
-const menu = (
14
-  <Menu onClick={handleMenuClick}>
15
-    <Menu.Item key="1">
16
-      <Icon type="user" />
17
-      1st menu item
18
-    </Menu.Item>
19
-    <Menu.Item key="2">
20
-      <Icon type="user" />
21
-      2nd menu item
22
-    </Menu.Item>
23
-    <Menu.Item key="3">
24
-      <Icon type="user" />
25
-      3rd item
26
-    </Menu.Item>
27
-  </Menu>
28
-);
29
-const dataSource = [
30
-  {
31
-    key: '1',
32
-    img: 'http://img0.imgtn.bdimg.com/it/u=4246326797,2657995307&fm=26&gp=0.jpg',
33
-    name: '123',
34
-    age: 32,
35
-    address: '西湖区湖底公园1号',
36
-  },
37
-  {
38
-    key: '2',
39
-    img: '',
40
-    age: 42,
41
-    address: '西湖区湖底公园1号',
42
-  },
43
-];
10
+// const dataSource = [
11
+//   {
12
+//     key: '1',
13
+//     img: 'http://img0.imgtn.bdimg.com/it/u=4246326797,2657995307&fm=26&gp=0.jpg',
14
+//     name: '123',
15
+//     age: 32,
16
+//     address: '西湖区湖底公园1号',
17
+//   },
18
+//   {
19
+//     key: '2',
20
+//     img: '',
21
+//     age: 42,
22
+//     address: '西湖区湖底公园1号',
23
+//   },
24
+// ];
44 25
 
45 26
 const columns = [
46 27
   // {
@@ -53,52 +34,52 @@ const columns = [
53 34
   // },
54 35
   {
55 36
     title: '渠道代码',
56
-    dataIndex: 'name',
57
-    key: 'name',
37
+    dataIndex: 'channelCode',
38
+    key: 'channelCode',
58 39
     align: 'center',
59 40
     render: text => <a>{text}</a>,
60 41
   },
61 42
   {
62 43
     title: '渠道名称',
63
-    dataIndex: 'integral',
64
-    key: 'integral',
44
+    dataIndex: 'channelName',
45
+    key: 'channelName',
65 46
     align: 'center',
66 47
   },
67 48
   {
68 49
     title: '联系人',
69
-    dataIndex: 'total',
70
-    key: 'total',
50
+    dataIndex: 'channelContact',
51
+    key: 'channelContact',
71 52
     align: 'center',
72 53
   },
73 54
   {
74 55
     title: '联系电话',
75
-    dataIndex: 'exchanged',
76
-    key: 'exchanged',
56
+    dataIndex: 'contactTel',
57
+    key: 'contactTel',
77 58
     align: 'center',
78 59
   },
79 60
   {
80
-    title: '经纪人',
81
-    dataIndex: 'rest',
82
-    key: 'rest',
61
+    title: '经纪人',
62
+    dataIndex: 'agentsNum',
63
+    key: 'agentsNum',
83 64
     align: 'center',
84 65
   },
85 66
   {
86 67
     title: '推荐客户有效',
87
-    dataIndex: 'state',
88
-    key: 'state',
68
+    dataIndex: 'recommendEffective',
69
+    key: 'recommendEffective',
89 70
     align: 'center',
90 71
   },
91 72
   {
92 73
     title: '邀请经济人',
93
-    dataIndex: 'handle',
94
-    key: 'handle',
74
+    dataIndex: 'agentsInvite',
75
+    key: 'agentsInvite',
95 76
     align: 'center',
96
-    render: () => <a>Delete</a>,
77
+    // render: () => <a>Delete</a>,
97 78
   },
98 79
   {
99 80
     title: '操作',
100
-    dataIndex: 'handle',
101
-    key: 'handle',
81
+    dataIndex: '',
82
+    key: '',
102 83
     align: 'center',
103 84
     render: () => <a style={ { color: '#66B3FF' } }>编辑</a>,
104 85
   },
@@ -113,28 +94,66 @@ function toEditGoods() {
113 94
     },
114 95
   });
115 96
 }
116
-export default () => (
117
-  <>
118
-    <div className={channels.searchBox}>
119
-      <dvi>
120
-        <span className={channels.selectName}>渠道名称</span>
121
-        <Select defaultValue="lucy" style={{ width: 180 }} onChange={handleChange}>
122
-          <Option value="jack">Jack</Option>
123
-          <Option value="lucy">Lucy</Option>
124
-          <Option value="disabled" disabled>
125
-            Disabled
126
-          </Option>
127
-          <Option value="Yiminghe">yiminghe</Option>
128
-        </Select>
129
-      </dvi>
130
-      <Button className={channels.about}>查询</Button>
131
-    </div>
132
-    <Button className={channels.addBtn} onClick={toEditGoods}>新增</Button>
133
-    <Table dataSource={dataSource} columns={columns} />
134
-  </>
135
-);
136 97
 
137
-function handleMenuClick(e) {
138
-  message.info('Click on menu item.');
139
-  console.log('click', e);
98
+const header = props => {
99
+  // eslint-disable-next-line react-hooks/rules-of-hooks
100
+  const [data, setData] = useState({ channelNmae: [], result: [] })
101
+  // eslint-disable-next-line react-hooks/rules-of-hooks
102
+  // const [queryData, setQueryData] = useState({ pageNum: 1, pageSize: 10 })
103
+  //   const [page, changePage] = useState({})
104
+  // eslint-disable-next-line react-hooks/rules-of-hooks
105
+  useEffect(() => {
106
+    getList({ pageNum: 1, pageSize: 10 })
107
+  }, [])
108
+
109
+  function getList(params) {
110
+    request({
111
+      url: '/api/admin/channel',
112
+      method: 'GET',
113
+      params: { ...params },
114
+  // eslint-disable-next-line no-shadow
115
+  }).then(data => {
116
+      console.log(data)
117
+      setData(data)
118
+  })
119
+  }
120
+  // value 的值
121
+  function handleChange(value) {
122
+    // setQueryData({ ...queryData, channelId: value });
123
+    localStorage.setItem('value', value);
124
+  }
125
+  // 查询
126
+  function queryList() {
127
+    getList({ pageNum: 1, pageSize: 10, channelId: localStorage.getItem('value') })
128
+  }
129
+ // 重置
130
+ function reset() {
131
+  getList({ pageNum: 1, pageSize: 10 })
132
+ }
133
+  return (
134
+    <>
135
+      <div className={channels.searchBox}>
136
+        <dvi>
137
+          <span className={channels.selectName}>渠道名称</span>
138
+          <Select defaultValue="请选择" style={{ width: 180 }} onChange={handleChange}>
139
+          <option value="">全部</option>
140
+              {data.channelNmae.map(Item =>
141
+                <Option value={ Item.channelId }> { Item.channelName } </Option>,
142
+              )}
143
+              {/* {listItems} */}
144
+          </Select>
145
+
146
+        </dvi>
147
+        <div >
148
+        <Button style ={{ backgroundColor: '#00bfff' } } onClick={() => queryList() }>查询</Button>
149
+        <Button onClick={() => reset() }>重置</Button>
150
+        </div>
151
+      </div>
152
+      <Button className={channels.addBtn} onClick={toEditGoods}>新增</Button>
153
+      <Table dataSource={data.result.records} columns={columns} />
154
+  </>
155
+  )
140 156
 }
157
+
158
+
159
+export default header

+ 50
- 17
src/pages/channel/recommendClients.jsx Прегледај датотеку

@@ -1,8 +1,9 @@
1
-import React from 'react';
1
+import React, { useState, useEffect } from 'react';
2 2
 import { Input, Menu, Dropdown, Button, Icon, message, Table, Divider, Tag, Select } from 'antd';
3 3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4 4
 import channels from './channelList.less';
5 5
 import router from 'umi/router';
6
+import request from '../../utils/request'
6 7
 
7 8
 const { Option } = Select;
8 9
 function handleChange(value) {
@@ -45,11 +46,11 @@ const dataSource = [
45 46
 const columns = [
46 47
   {
47 48
     title: '头像',
48
-    dataIndex: 'img',
49
-    key: 'img',
49
+    // dataIndex: 'img',
50
+    // key: 'img',
50 51
     align: 'center',
51 52
 
52
-    render: (text, record) => <img src={record.img} className={channels.touxiang} />,
53
+    render: (text, record) => <img src={record.picture} className={channels.touxiang} />,
53 54
   },
54 55
   {
55 56
     title: '用户姓名',
@@ -60,32 +61,32 @@ const columns = [
60 61
   },
61 62
   {
62 63
     title: '电话',
63
-    dataIndex: 'integral',
64
-    key: 'integral',
64
+    dataIndex: 'recommendTel',
65
+    key: 'recommendTel',
65 66
     align: 'center',
66 67
   },
67 68
   {
68 69
     title: '性别',
69
-    dataIndex: 'total',
70
-    key: 'total',
70
+    dataIndex: 'sex',
71
+    key: 'sex',
71 72
     align: 'center',
72 73
   },
73 74
   {
74 75
     title: '意向项目',
75
-    dataIndex: 'exchanged',
76
-    key: 'exchanged',
76
+    dataIndex: 'intention',
77
+    key: 'intention',
77 78
     align: 'center',
78 79
   },
79 80
   {
80 81
     title: '推荐时间',
81
-    dataIndex: 'rest',
82
-    key: 'rest',
82
+    dataIndex: 'createDate',
83
+    key: 'createDate',
83 84
     align: 'center',
84 85
   },
85 86
   {
86 87
     title: '状态',
87
-    dataIndex: 'rest',
88
-    key: 'rest',
88
+    dataIndex: 'status',
89
+    key: 'status',
89 90
     align: 'center',
90 91
   },
91 92
 ];
@@ -99,11 +100,43 @@ function toEditGoods() {
99 100
     },
100 101
   });
101 102
 }
102
-export default () => (
103
-    <Table dataSource={dataSource} columns={columns} />
104
-);
103
+const header = props => {
104
+  // eslint-disable-next-line react-hooks/rules-of-hooks
105
+  const [data, setData] = useState({})
106
+//   const [page, changePage] = useState({})
107
+  // eslint-disable-next-line react-hooks/rules-of-hooks
108
+  useEffect(() => {
109
+    request({
110
+        url: '/api/admin/customer/recommend/recommender',
111
+        method: 'GET',
112
+        params: { pageNum: 1, pageSize: 10 },
113
+    // eslint-disable-next-line no-shadow
114
+    }).then(data => {
115
+        console.log(data)
116
+        setData(data)
117
+    })
118
+  }, [])
119
+
120
+  const getList = e => {
121
+    request({
122
+        url: '/api/xxx',
123
+        method: 'GET',
124
+        params: {},
125
+    // eslint-disable-next-line no-shadow
126
+    }).then(data => {
127
+        setData(data)
128
+    })
129
+  }
130
+
131
+return (
132
+  <>
133
+    <Table dataSource={data.records} columns={columns} />
134
+  </>
135
+)
136
+}
105 137
 
106 138
 function handleMenuClick(e) {
107 139
   message.info('Click on menu item.');
108 140
   console.log('click', e);
109 141
 }
142
+export default header

+ 66
- 0
src/pages/customer/drift/index.jsx Прегледај датотеку

@@ -0,0 +1,66 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Table, Avatar, Alert } from 'antd';
3
+
4
+import request from '../../../utils/request';
5
+import apis from '../../../services/apis';
6
+
7
+function costomerDrift() {
8
+  // eslint-disable-next-line react-hooks/rules-of-hooks
9
+  const [dataSources, setDataSources] = useState({ records: [] })
10
+
11
+  // eslint-disable-next-line react-hooks/rules-of-hooks
12
+  useEffect(() => {
13
+   getList({ pageNumber: '1', pageSize: '10' })
14
+  }, [])
15
+
16
+  function getList(params) {
17
+    request({ ...apis.customer.drift, params: { ...params } }).then(res => {
18
+      setDataSources(res)
19
+    }).catch(err => {
20
+      // eslint-disable-next-line no-unused-expressions
21
+      <Alert
22
+        style={{
23
+          marginBottom: 24,
24
+        }}
25
+        message={err}
26
+        type="error"
27
+        showIcon
28
+      />
29
+    })
30
+  }
31
+
32
+  // 分页
33
+  function onChange(pageNum) {
34
+    // eslint-disable-next-line no-console
35
+    console.log('Page: ', pageNum);
36
+    getList({ pageNumber: pageNum, pageSize: 10 })
37
+  }
38
+
39
+  const columns = [
40
+    {
41
+      title: '头像',
42
+      dataIndex: 'avatarurl',
43
+      key: 'avatarurl',
44
+      render: (_, record) => <Avatar shape="square" src={record.avatarurl} size={64} icon="user" />,
45
+    },
46
+    {
47
+      title: '姓名',
48
+      dataIndex: 'nickname',
49
+      key: 'nickname',
50
+    },
51
+    {
52
+      title: '性别',
53
+      dataIndex: 'gender',
54
+      key: 'gender',
55
+      // eslint-disable-next-line no-nested-ternary
56
+      render: (_, record) => <><sapn>{ record.gender === '1' ? '男' : record.gender === '2' ? '女' : '未知' }</sapn></>,
57
+    },
58
+  ];
59
+
60
+  return (
61
+    // eslint-disable-next-line max-len
62
+    <Table dataSource={dataSources.records} columns={columns} pagination={{ total: dataSources.total, onChange }} />
63
+  )
64
+}
65
+
66
+export default costomerDrift

+ 165
- 0
src/pages/customer/independentList/index.jsx Прегледај датотеку

@@ -0,0 +1,165 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar } from 'antd';
3
+import moment from 'moment';
4
+import request from '../../../utils/request';
5
+import apis from '../../../services/apis';
6
+import Styles from './style.less';
7
+import { router } from 'umi';
8
+
9
+
10
+const { Option } = Select;
11
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
12
+const { Meta } = Card;
13
+
14
+/**
15
+ *
16
+ *
17
+ * @param {*} props
18
+ * @returns
19
+ */
20
+function body(props) {
21
+  const { getFieldDecorator } = props.form
22
+
23
+  // eslint-disable-next-line react-hooks/rules-of-hooks
24
+  const [dataSource, setDataSource] = useState({ records: [] })
25
+
26
+  // eslint-disable-next-line react-hooks/rules-of-hooks
27
+  useEffect(() => {
28
+    getList({ pageNumber: 1, pageSize: 10 })
29
+  }, [])
30
+
31
+  function getList(params) {
32
+    // 网路请求
33
+    request({ ...apis.customer.agents, params: { ...params } }).then(res => {
34
+      setDataSource(res)
35
+    }).catch(err => {
36
+      // eslint-disable-next-line no-unused-expressions
37
+      <Alert
38
+        style={{
39
+          marginBottom: 24,
40
+        }}
41
+        message={err}
42
+        type="error"
43
+        showIcon
44
+      />
45
+    })
46
+  }
47
+
48
+  // 提交事件
49
+  function handleSubmit(e) {
50
+    e.preventDefault();
51
+    props.form.validateFields((err, values) => {
52
+      if (!err) {
53
+        getList({ pageNum: 1, pageSize: 10, ...values })
54
+      }
55
+    });
56
+  }
57
+
58
+  // Change 事件
59
+  function handleSelectChange(e) {
60
+    // eslint-disable-next-line no-console
61
+    console.log(e)
62
+  }
63
+
64
+  // 分页
65
+  function onChange(pageNum) {
66
+    // eslint-disable-next-line react-hooks/rules-of-hooks
67
+      getList({ pageNumber: pageNum, pageSize: 10 })
68
+  }
69
+
70
+  function toAudit(cuurentId) {
71
+    router.push({
72
+      pathname: '/customer/recommendCustomer/audit',
73
+      query: {
74
+        id: cuurentId,
75
+      },
76
+    })
77
+  }
78
+
79
+  const columns = [
80
+    {
81
+      title: '头像',
82
+      dataIndex: 'avatarurl',
83
+      key: 'avatarurl',
84
+      render: (_, record) => <Avatar shape="square" src={record.avatarurl} size={64} icon="user" />,
85
+    },
86
+    {
87
+      title: '姓名',
88
+      dataIndex: 'nickname',
89
+      key: 'nickname',
90
+    },
91
+    {
92
+      title: '电话',
93
+      dataIndex: 'phone',
94
+      key: 'phone',
95
+    },
96
+    {
97
+      title: '类型',
98
+      dataIndex: 'personTtype',
99
+      key: 'personType',
100
+    },
101
+    {
102
+      title: '所属渠道',
103
+      dataIndex: 'qudao',
104
+      key: 'qudao',
105
+    },
106
+    {
107
+      title: '性别',
108
+      dataIndex: 'gender',
109
+      key: 'gender',
110
+      // eslint-disable-next-line no-nested-ternary
111
+      render: (_, record) => <><sapn>{ record.gender === '1' ? '男' : record.gender === '2' ? '女' : '未知' }</sapn></>,
112
+    },
113
+    {
114
+      title: '操作',
115
+      dataIndex: 'customerId',
116
+      key: 'customerId',
117
+      render: (_, record) => (
118
+        <>
119
+          {
120
+            <>
121
+              <sapn style={{ color: 'rgba(239,39,58,1)' }}>查看详细</sapn>
122
+              &nbsp;&nbsp;&nbsp;&nbsp;
123
+              <sapn style={{ color: 'rgba(239,39,58,1)' }}>邀请经纪人</sapn>
124
+              &nbsp;&nbsp;&nbsp;&nbsp;
125
+              <sapn style={{ color: 'rgba(239,39,58,1)' }}>推荐客户</sapn>
126
+            </>
127
+          }
128
+        </>
129
+      ),
130
+    },
131
+  ]
132
+
133
+  return (
134
+    <>
135
+      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
136
+        <Form.Item>
137
+          {getFieldDecorator('name')(
138
+            <Input
139
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
140
+              placeholder="姓名"
141
+            />,
142
+          )}
143
+        </Form.Item>
144
+        <Form.Item>
145
+          {getFieldDecorator('tel')(
146
+            <Input
147
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
148
+              placeholder="电话"
149
+            />,
150
+          )}
151
+        </Form.Item>
152
+        <Form.Item>
153
+          <Button type="primary" htmlType="submit" className={Styles.SubmitButton}>
154
+            搜索
155
+          </Button>
156
+        </Form.Item>
157
+      </Form>
158
+
159
+      <Table dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />
160
+    </>
161
+  );
162
+}
163
+const WrappedBody = Form.create({ name: 'body' })(body);
164
+
165
+export default WrappedBody

+ 57
- 0
src/pages/customer/independentList/style.less Прегледај датотеку

@@ -0,0 +1,57 @@
1
+.SubmitButton {
2
+  background: #3a91d5;
3
+  border-radius: 7px;
4
+  border: 0px;
5
+}
6
+.SelectFrom {
7
+  width: 180px;
8
+  background: #ffffff;
9
+  border-radius: 7px;
10
+  border: 1px solid #dbdbdb;
11
+}
12
+.addButton {
13
+  background: #50be00;
14
+  border-radius: 4px;
15
+  border: 0px;
16
+  margin: 10px 0px;
17
+}
18
+.cardText {
19
+  font-size: 18px;
20
+  color: #333;
21
+  line-height: 24px;
22
+  display: flex;
23
+  align-items: center;
24
+  position: relative;
25
+
26
+}
27
+.cardItem{
28
+  font-size: 18px;
29
+  font-weight: 400;
30
+  color: #666;
31
+  line-height: 24px;
32
+  display: flex;
33
+  align-items: center;  
34
+}
35
+.ediText {
36
+  font-size: 18px;
37
+  color: #ff925c;
38
+  line-height: 24px;
39
+  position: absolute;
40
+  right: 0;
41
+}
42
+.title{
43
+  display: inline-block;
44
+  width: 84px;
45
+  justify-content: space-between;
46
+  text-align: justify;
47
+  text-align-last:justify
48
+}
49
+
50
+.address { 
51
+  width: 400px;
52
+  height: 24px; 
53
+  text-overflow: ellipsis; 
54
+  white-space: nowrap;
55
+  overflow: hidden;
56
+}
57
+

+ 201
- 0
src/pages/customer/recommendCustomer/audit.jsx Прегледај датотеку

@@ -0,0 +1,201 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Radio, Upload, message } from 'antd';
3
+import ImageUpload from '../../../components/XForm/ImageUpload';
4
+import moment from 'moment';
5
+import request from '../../../utils/request';
6
+import apis from '../../../services/apis';
7
+import Styles from './style.less';
8
+import { router } from 'umi';
9
+
10
+const { Option } = Select;
11
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
12
+const { Meta } = Card;
13
+
14
+const { TextArea } = Input;
15
+
16
+const tailFormItemLayout = {
17
+  labelCol: {
18
+    xs: { span: 20 },
19
+    sm: { span: 3 },
20
+  },
21
+  wrapperCol: {
22
+    xs: { span: 20 },
23
+    sm: { span: 16 },
24
+  },
25
+};
26
+
27
+function body(props) {
28
+  const { getFieldDecorator } = props.form
29
+
30
+  // eslint-disable-next-line react-hooks/rules-of-hooks
31
+  const [dataSource, setDataSource] = useState({ picture: '' })
32
+
33
+  const { id } = props.location.query;
34
+
35
+  if (id !== '') {
36
+    // eslint-disable-next-line react-hooks/rules-of-hooks
37
+    useEffect(() => {
38
+      getById(id)
39
+    }, [])
40
+  }
41
+
42
+  // 获取详情信息
43
+  function getById(currentId) {
44
+    const { url, method } = apis.customer.recommendGetById
45
+    const tempUrl = url.substring(0, url.lastIndexOf('id')).concat(currentId)
46
+
47
+    request({ url: tempUrl, method }).then(res => {
48
+      props.form.setFieldsValue(res)
49
+    })
50
+  }
51
+
52
+  function submitDate(params) {
53
+    const { url, method } = apis.customer.auto
54
+    const tempUrl = url.substring(0, url.lastIndexOf('id')).concat(params.customerId)
55
+
56
+    // props.form.setFieldsValue(res)
57
+    request({ url: tempUrl, method, params: { verifyStatus: params.verifyStatus } }).then(() => {
58
+      // eslint-disable-next-line no-unused-expressions
59
+      <Alert
60
+        style={{
61
+          marginBottom: 24,
62
+        }}
63
+        message="操作成功"
64
+        type="success"
65
+        showIcon
66
+      />
67
+      router.go(-1)
68
+    }).catch(err => {
69
+      // eslint-disable-next-line no-unused-expressions
70
+      <Alert
71
+        style={{
72
+          marginBottom: 24,
73
+        }}
74
+        message={err}
75
+        type="error"
76
+        showIcon
77
+      />
78
+    })
79
+  }
80
+
81
+  // 提交事件
82
+  function handleSubmit(e) {
83
+    e.preventDefault();
84
+    props.form.validateFields((err, values) => {
85
+      if (!err) {
86
+        submitDate({ ...values })
87
+      }
88
+    });
89
+  }
90
+
91
+  // Change 事件
92
+  function handleSelectChange(e) {
93
+    // eslint-disable-next-line no-console
94
+    console.log(e)
95
+  }
96
+
97
+  return (
98
+    <>
99
+      <Form {...tailFormItemLayout} onSubmit={e => handleSubmit(e, props)} style={{ width: '800px', margin: 'auto' }}>
100
+        <Form.Item label="客户ID" style={{ display: 'none' }}>
101
+          {getFieldDecorator('customerId')(
102
+            <Input
103
+              placeholder="客户ID"
104
+            />,
105
+          )}
106
+        </Form.Item>
107
+        <Form.Item label="意向项目:">
108
+          {getFieldDecorator('intention')(
109
+            <Input
110
+              placeholder="意向项目"
111
+            />,
112
+          )}
113
+        </Form.Item>
114
+        <Form.Item label="客户照片">
115
+          {getFieldDecorator('picture')(
116
+            <ImageUpload value={dataSource.picture} />,
117
+          )}
118
+        </Form.Item>
119
+        <Form.Item label="客户姓名">
120
+          {getFieldDecorator('name')(
121
+            <Input placeholder="客户姓名" />,
122
+          )}
123
+        </Form.Item>
124
+        <Form.Item label="客户电话">
125
+          {getFieldDecorator('phone')(
126
+            <Input placeholder="客户电话" />,
127
+          )}
128
+        </Form.Item>
129
+        <Form.Item label="客户性别">
130
+          {getFieldDecorator('sex')(
131
+            <Radio.Group>
132
+              <Radio value={1}>男</Radio>
133
+              <Radio value={2}>女</Radio>
134
+            </Radio.Group>,
135
+          )}
136
+        </Form.Item>
137
+        <Form.Item label="到访人数">
138
+          {getFieldDecorator('visiteNum')(
139
+            <Input placeholder="到访人数" />,
140
+          )}
141
+        </Form.Item>
142
+        <Form.Item label="客户描述">
143
+          {getFieldDecorator('describe')(
144
+            <TextArea placeholder="客户描述" rows={10} />,
145
+          )}
146
+        </Form.Item>
147
+        <Form.Item label="物业类型">
148
+          {getFieldDecorator('realtyManageType')(
149
+            <Input placeholder="物业类型" />,
150
+          )}
151
+        </Form.Item>
152
+        <Form.Item label="需求类型">
153
+          {getFieldDecorator('demandType')(
154
+            <Input placeholder="需求类型" />,
155
+          )}
156
+        </Form.Item>
157
+        <Form.Item label="价格区间">
158
+          {getFieldDecorator('priceRange')(
159
+            <Input placeholder="价格区间" />,
160
+          )}
161
+        </Form.Item>
162
+        <Form.Item label="报备日期">
163
+          {getFieldDecorator('reportDate')(
164
+            <DatePicker showTime placeholder="报备日期" />,
165
+          )}
166
+        </Form.Item>
167
+        <Form.Item label="状态">
168
+          {getFieldDecorator('verifyStatus')(
169
+            <Select style={{ width: '180px' }} placeholder="状态" onChange={handleSelectChange}>
170
+              <Option value={0}>未通过</Option>
171
+              <Option value={1}>已通过</Option>
172
+              <Option value={2}>已驳回</Option>
173
+            </Select>,
174
+          )}
175
+        </Form.Item>
176
+        <Form.Item label="归属置业顾问">
177
+            <Row gutter={8}>
178
+              <Col span={12}>
179
+                {getFieldDecorator('consultantName')(<Input placeholder="归属置业顾问" />)}
180
+              </Col>
181
+              <Col span={12}>
182
+                <Button>选择</Button>
183
+              </Col>
184
+            </Row>
185
+        </Form.Item>
186
+        <Form.Item style={{ display: 'flex', justifyContent: 'center' }}>
187
+          <Button type="primary" htmlType="submit" className={Styles.SubmitButton}>
188
+            搜索
189
+          </Button>
190
+          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
191
+          <Button onClick={() => router.go(-1)}>
192
+            取消
193
+          </Button>
194
+        </Form.Item>
195
+      </Form>
196
+    </>
197
+  );
198
+}
199
+const WrappedBody = Form.create({ name: 'body' })(body);
200
+
201
+export default WrappedBody

+ 191
- 0
src/pages/customer/recommendCustomer/index.jsx Прегледај датотеку

@@ -0,0 +1,191 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar } from 'antd';
3
+import moment from 'moment';
4
+import request from '../../../utils/request';
5
+import apis from '../../../services/apis';
6
+import Styles from './style.less';
7
+import { router } from 'umi';
8
+
9
+
10
+const { Option } = Select;
11
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
12
+const { Meta } = Card;
13
+
14
+/**
15
+ *
16
+ *
17
+ * @param {*} props
18
+ * @returns
19
+ */
20
+function body(props) {
21
+  const { getFieldDecorator } = props.form
22
+
23
+  // eslint-disable-next-line react-hooks/rules-of-hooks
24
+  const [dataSource, setDataSource] = useState({ records: [] })
25
+
26
+  // eslint-disable-next-line react-hooks/rules-of-hooks
27
+  useEffect(() => {
28
+    getList({ pageNumber: 1, pageSize: 10 })
29
+  }, [])
30
+
31
+  function getList(params) {
32
+    // 网路请求
33
+    request({ ...apis.customer.recommender, params: { ...params } }).then(res => {
34
+      setDataSource(res)
35
+    }).catch(err => {
36
+      // eslint-disable-next-line no-unused-expressions
37
+      <Alert
38
+        style={{
39
+          marginBottom: 24,
40
+        }}
41
+        message={err}
42
+        type="error"
43
+        showIcon
44
+      />
45
+    })
46
+  }
47
+
48
+  // 提交事件
49
+  function handleSubmit(e) {
50
+    e.preventDefault();
51
+    props.form.validateFields((err, values) => {
52
+      if (!err) {
53
+        getList({ pageNum: 1, pageSize: 10, ...values })
54
+      }
55
+    });
56
+  }
57
+
58
+  // Change 事件
59
+  function handleSelectChange(e) {
60
+    // eslint-disable-next-line no-console
61
+    console.log(e)
62
+  }
63
+
64
+  // 分页
65
+  function onChange(pageNum) {
66
+    // eslint-disable-next-line react-hooks/rules-of-hooks
67
+      getList({ pageNumber: pageNum, pageSize: 10 })
68
+  }
69
+
70
+  function toAudit(cuurentId) {
71
+    router.push({
72
+      pathname: '/customer/recommendCustomer/audit',
73
+      query: {
74
+        id: cuurentId,
75
+      },
76
+    })
77
+  }
78
+
79
+  const columns = [
80
+    {
81
+      title: '头像',
82
+      dataIndex: 'picture',
83
+      key: 'picture',
84
+      render: (_, record) => <Avatar shape="square" src={record.picture} size={64} icon="user" />,
85
+    },
86
+    {
87
+      title: '姓名',
88
+      dataIndex: 'name',
89
+      key: 'name',
90
+    },
91
+    {
92
+      title: '电话',
93
+      dataIndex: 'phone',
94
+      key: 'phone',
95
+    },
96
+    {
97
+      title: '性别',
98
+      dataIndex: 'sex',
99
+      key: 'sex',
100
+      // eslint-disable-next-line no-nested-ternary
101
+      render: (_, record) => <><sapn>{ record.sex === 1 ? '男' : record.sex === 2 ? '女' : '未知' }</sapn></>,
102
+    },
103
+    {
104
+      title: '意向项目',
105
+      dataIndex: 'intention',
106
+      key: 'intention',
107
+    },
108
+    {
109
+      title: '推荐人',
110
+      dataIndex: 'consultantName',
111
+      key: 'consultantName',
112
+      render: (_, record) => <><sapn>{ record.recommendName + " " + record.recommendTel }</sapn></>,
113
+    },
114
+    {
115
+      title: '推荐时间',
116
+      dataIndex: 'createDate',
117
+      key: 'createDate',
118
+      render: (_, record) => <><sapn>{ moment(record.createDate).format('YYYY-MM-DD') }</sapn></>,
119
+    },
120
+    {
121
+      title: '状态',
122
+      dataIndex: 'createDate',
123
+      key: 'createDate',
124
+      render: (_, record) => <><sapn>{ record.verifyStatus === 0 ? '未通过': record.verifyStatus === 1 ? '已通过' : record.verifyStatus === 2 ? '已驳回' : '' }</sapn></>,
125
+    },
126
+    {
127
+      title: '操作',
128
+      dataIndex: 'customerId',
129
+      key: 'customerId',
130
+      render: (_, record) => (
131
+        <>
132
+          {
133
+            record.verifyStatus === 0 ? <sapn style={{ color: 'rgba(239,39,58,1)' }} onClick={() => toAudit(record.customerId)}>审核</sapn> : ''
134
+          }
135
+        </>
136
+      ),
137
+    },
138
+  ]
139
+
140
+  return (
141
+    <>
142
+      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
143
+        <Form.Item>
144
+          {getFieldDecorator('name')(
145
+            <Input
146
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
147
+              placeholder="姓名"
148
+            />,
149
+          )}
150
+        </Form.Item>
151
+        <Form.Item>
152
+          {getFieldDecorator('tel')(
153
+            <Input
154
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
155
+              placeholder="电话"
156
+            />,
157
+          )}
158
+        </Form.Item>
159
+        <Form.Item>
160
+          {getFieldDecorator('consultName')(
161
+            <Input placeholder="推荐人" />,
162
+          )}
163
+        </Form.Item>
164
+        <Form.Item>
165
+          {getFieldDecorator('consultTel')(
166
+            <Input placeholder="推荐人电话" />,
167
+          )}
168
+        </Form.Item>
169
+        <Form.Item>
170
+          {getFieldDecorator('verifyStatus')(
171
+            <Select style={{ width: '180px' }} placeholder="状态" onChange={handleSelectChange}>
172
+              <Option value={0}>未通过</Option>
173
+              <Option value={1}>已通过</Option>
174
+              <Option value={2}>已驳回</Option>
175
+            </Select>,
176
+          )}
177
+        </Form.Item>
178
+        <Form.Item>
179
+          <Button type="primary" htmlType="submit" className={Styles.SubmitButton}>
180
+            搜索
181
+          </Button>
182
+        </Form.Item>
183
+      </Form>
184
+
185
+      <Table dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />
186
+    </>
187
+  );
188
+}
189
+const WrappedBody = Form.create({ name: 'body' })(body);
190
+
191
+export default WrappedBody

+ 57
- 0
src/pages/customer/recommendCustomer/style.less Прегледај датотеку

@@ -0,0 +1,57 @@
1
+.SubmitButton {
2
+  background: #3a91d5;
3
+  border-radius: 7px;
4
+  border: 0px;
5
+}
6
+.SelectFrom {
7
+  width: 180px;
8
+  background: #ffffff;
9
+  border-radius: 7px;
10
+  border: 1px solid #dbdbdb;
11
+}
12
+.addButton {
13
+  background: #50be00;
14
+  border-radius: 4px;
15
+  border: 0px;
16
+  margin: 10px 0px;
17
+}
18
+.cardText {
19
+  font-size: 18px;
20
+  color: #333;
21
+  line-height: 24px;
22
+  display: flex;
23
+  align-items: center;
24
+  position: relative;
25
+
26
+}
27
+.cardItem{
28
+  font-size: 18px;
29
+  font-weight: 400;
30
+  color: #666;
31
+  line-height: 24px;
32
+  display: flex;
33
+  align-items: center;  
34
+}
35
+.ediText {
36
+  font-size: 18px;
37
+  color: #ff925c;
38
+  line-height: 24px;
39
+  position: absolute;
40
+  right: 0;
41
+}
42
+.title{
43
+  display: inline-block;
44
+  width: 84px;
45
+  justify-content: space-between;
46
+  text-align: justify;
47
+  text-align-last:justify
48
+}
49
+
50
+.address { 
51
+  width: 400px;
52
+  height: 24px; 
53
+  text-overflow: ellipsis; 
54
+  white-space: nowrap;
55
+  overflow: hidden;
56
+}
57
+

+ 169
- 0
src/pages/customer/report/index.jsx Прегледај датотеку

@@ -0,0 +1,169 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar } from 'antd';
3
+import moment from 'moment';
4
+import request from '../../../utils/request';
5
+import apis from '../../../services/apis';
6
+import Styles from './style.less';
7
+
8
+
9
+const { Option } = Select;
10
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
11
+const { Meta } = Card;
12
+
13
+const tempDate = [{ code: 's101' }]
14
+
15
+/**
16
+ *
17
+ *
18
+ * @param {*} props
19
+ * @returns
20
+ */
21
+function body(props) {
22
+  const { getFieldDecorator } = props.form
23
+
24
+  // eslint-disable-next-line react-hooks/rules-of-hooks
25
+  const [dataSource, setDataSource] = useState({ records: [] })
26
+
27
+  // eslint-disable-next-line react-hooks/rules-of-hooks
28
+  useEffect(() => {
29
+    getList({ pageNumber: 1, pageSize: 9 })
30
+  }, [])
31
+
32
+  function getList(params) {
33
+    // 网路请求
34
+    request({ ...apis.customer.report, params: { ...params } }).then(res => {
35
+      setDataSource(res)
36
+    }).catch(err => {
37
+      // eslint-disable-next-line no-unused-expressions
38
+      <Alert
39
+        style={{
40
+          marginBottom: 24,
41
+        }}
42
+        message={err}
43
+        type="error"
44
+        showIcon
45
+      />
46
+    })
47
+  }
48
+
49
+  // 提交事件
50
+  function handleSubmit(e) {
51
+    e.preventDefault();
52
+    props.form.validateFields((err, values) => {
53
+      if (!err) {
54
+        getList({ pageNum: 1, pageSize: 10, ...values })
55
+      }
56
+    });
57
+  }
58
+
59
+  // Change 事件
60
+  function handleSelectChange(e) {
61
+    // eslint-disable-next-line no-console
62
+    console.log(e)
63
+  }
64
+
65
+  // 分页
66
+  function onChange(pageNum) {
67
+    // eslint-disable-next-line react-hooks/rules-of-hooks
68
+      getList({ pageNumber: pageNum, pageSize: 9 })
69
+  }
70
+
71
+  const columns = [
72
+    {
73
+      title: '头像',
74
+      dataIndex: 'picture',
75
+      key: 'picture',
76
+      render: (_, record) => <Avatar shape="square" src={record.picture} size={64} icon="user" />,
77
+    },
78
+    {
79
+      title: '姓名',
80
+      dataIndex: 'name',
81
+      key: 'name',
82
+    },
83
+    {
84
+      title: '电话',
85
+      dataIndex: 'phone',
86
+      key: 'phone',
87
+    },
88
+    {
89
+      title: '性别',
90
+      dataIndex: 'sex',
91
+      key: 'sex',
92
+      // eslint-disable-next-line no-nested-ternary
93
+      render: (_, record) => <><sapn>{ record.sex === 1 ? '男' : record.sex === 2 ? '女' : '未知' }</sapn></>,
94
+    },
95
+    {
96
+      title: '意向项目',
97
+      dataIndex: 'intention',
98
+      key: 'intention',
99
+    },
100
+    {
101
+      title: '置业顾问',
102
+      dataIndex: 'consultantName',
103
+      key: 'consultantName',
104
+    },
105
+    {
106
+      title: '置业顾问手机号',
107
+      dataIndex: 'consultTel',
108
+      key: 'consultTel',
109
+    },
110
+  ]
111
+
112
+  return (
113
+    <>
114
+      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
115
+        <Form.Item>
116
+          {getFieldDecorator('name')(
117
+            <Input
118
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
119
+              placeholder="姓名"
120
+            />,
121
+          )}
122
+        </Form.Item>
123
+        <Form.Item>
124
+          {getFieldDecorator('tel')(
125
+            <Input
126
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
127
+              placeholder="电话"
128
+            />,
129
+          )}
130
+        </Form.Item>
131
+        <Form.Item>
132
+          {getFieldDecorator('consultName')(
133
+            <Input placeholder="推荐人" />,
134
+          )}
135
+        </Form.Item>
136
+        <Form.Item>
137
+          {getFieldDecorator('consultTel')(
138
+            <Input placeholder="推荐电话" />,
139
+          )}
140
+        </Form.Item>
141
+        <Form.Item>
142
+          {getFieldDecorator('sex')(
143
+            <Select style={{ width: '180px' }} placeholder="性别" onChange={handleSelectChange}>
144
+              <Option value="1">男</Option>
145
+              <Option value="0">女</Option>
146
+            </Select>,
147
+          )}
148
+        </Form.Item>
149
+        <Form.Item>
150
+          {getFieldDecorator('buildingId')(
151
+            <Select style={{ width: '180px' }} placeholder="意向项目" onChange={handleSelectChange}>
152
+              <Option value="male">male</Option>
153
+            </Select>,
154
+          )}
155
+        </Form.Item>
156
+        <Form.Item>
157
+          <Button type="primary" htmlType="submit" className={Styles.SubmitButton}>
158
+            搜索
159
+          </Button>
160
+        </Form.Item>
161
+      </Form>
162
+
163
+      <Table dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />
164
+    </>
165
+  );
166
+}
167
+const WrappedBody = Form.create({ name: 'body' })(body);
168
+
169
+export default WrappedBody

+ 57
- 0
src/pages/customer/report/style.less Прегледај датотеку

@@ -0,0 +1,57 @@
1
+.SubmitButton {
2
+  background: #3a91d5;
3
+  border-radius: 7px;
4
+  border: 0px;
5
+}
6
+.SelectFrom {
7
+  width: 180px;
8
+  background: #ffffff;
9
+  border-radius: 7px;
10
+  border: 1px solid #dbdbdb;
11
+}
12
+.addButton {
13
+  background: #50be00;
14
+  border-radius: 4px;
15
+  border: 0px;
16
+  margin: 10px 0px;
17
+}
18
+.cardText {
19
+  font-size: 18px;
20
+  color: #333;
21
+  line-height: 24px;
22
+  display: flex;
23
+  align-items: center;
24
+  position: relative;
25
+
26
+}
27
+.cardItem{
28
+  font-size: 18px;
29
+  font-weight: 400;
30
+  color: #666;
31
+  line-height: 24px;
32
+  display: flex;
33
+  align-items: center;  
34
+}
35
+.ediText {
36
+  font-size: 18px;
37
+  color: #ff925c;
38
+  line-height: 24px;
39
+  position: absolute;
40
+  right: 0;
41
+}
42
+.title{
43
+  display: inline-block;
44
+  width: 84px;
45
+  justify-content: space-between;
46
+  text-align: justify;
47
+  text-align-last:justify
48
+}
49
+
50
+.address { 
51
+  width: 400px;
52
+  height: 24px; 
53
+  text-overflow: ellipsis; 
54
+  white-space: nowrap;
55
+  overflow: hidden;
56
+}
57
+

+ 26
- 0
src/services/apis.js Прегледај датотеку

@@ -39,4 +39,30 @@ export default {
39 39
       url: `${prefix}/tdBuildingType/id`,
40 40
     },
41 41
   },
42
+  customer: {
43
+    drift: {
44
+      method: 'GET',
45
+      url: `${prefix}/customer/recommend/drift`,
46
+    },
47
+    report: {
48
+      method: 'GET',
49
+      url: `${prefix}/customer/recommend/report`,
50
+    },
51
+    recommender: {
52
+      method: 'GET',
53
+      url: `${prefix}/customer/recommend/recommender`,
54
+    },
55
+    auto: {
56
+      method: 'PUT',
57
+      url: `${prefix}/customer/recommend/verify/id`,
58
+    },
59
+    recommendGetById: {
60
+      method: 'GET',
61
+      url: `${prefix}/customer/recommend/getById/id`,
62
+    },
63
+    agents: {
64
+      method: 'GET',
65
+      url: `${prefix}/customer/agents`,
66
+    },
67
+  },
42 68
 }