浏览代码

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

# Conflicts:
#	src/pages/integralMall/GoodsList.jsx
傅行帆 5 年前
父节点
当前提交
a4158bd26c

+ 9
- 0
config/config.js 查看文件

218
                   name: '',
218
                   name: '',
219
                   component: './channel/addChannel',
219
                   component: './channel/addChannel',
220
                 },
220
                 },
221
+                {
222
+                  path: '/channel/editChannel',
223
+                  name: '',
224
+                  component: './channel/editChannel',
225
+                },
221
                 {
226
                 {
222
                   path: '/channel/brokerList',
227
                   path: '/channel/brokerList',
223
                   name: '经纪人',
228
                   name: '经纪人',
291
   // Theme for antd: https://ant.design/docs/react/customize-theme-cn
296
   // Theme for antd: https://ant.design/docs/react/customize-theme-cn
292
   theme: {
297
   theme: {
293
     'primary-color': primaryColor,
298
     'primary-color': primaryColor,
299
+    'btn-primary-bg': '#EF273A',
300
+    'table-row-hover-bg': '#eee',
301
+    'btn-danger-bg': '#FF7E48',
302
+
294
   },
303
   },
295
   define: {
304
   define: {
296
     ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION:
305
     ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION:

+ 26
- 32
src/pages/Welcome.jsx 查看文件

17
 // );
17
 // );
18
 
18
 
19
 export default () => (
19
 export default () => (
20
-  <div className="gutter-example">
21
-    <Row gutter={20} type="flex" justify="space-around" align="middle">
22
-      <Col className="gutter-row" span={7} style={{
23
-        background: 'linear-gradient(180deg,rgba(246,168,30,1) 0%,rgba(250,86,139,1) 100%)', height: '150px',
24
-        boxShadow: '0px 1px 5px 1px rgba(0,0,0,0.2)',
25
-        borderRadius: '12px'
20
+  <>
21
+    <div style={{ display: 'flex' }}>
22
+      <div style={{
23
+        textAlign: 'center', display: 'flex', justifyContent: 'center', lineHeight: '100px', background: 'linear-gradient(144deg,rgba(241,43,62,1) 0%,rgba(254,144,155,1) 100%)', height: '100px',
24
+        boxShadow: '0px 18px 14px -15px rgba(241,43,62,1)',
25
+        borderRadius: '12px', width: '32%', marginRight: '2%'
26
       }}>
26
       }}>
27
-        <div className="gutter-box" style={{ textAlign: 'center' }}>
28
-          <p className="gutter-tit" style={{ fontSize: '24px', color: '#fff', margin: '26px 0 0 0 ' }}>总用户</p>
29
-          <p className="gutter-num" style={{ fontSize: '51px', color: '#fff', margin: '0' }}>133</p>
30
-        </div>
31
-      </Col>
32
-      <Col className="gutter-row" span={7} style={{
33
-        background: 'linear-gradient(180deg,rgba(78,239,186,1) 0%,rgba(63,197,224,1) 100%)', height: '150px',
34
-        boxShadow: '0px 1px 5px 1px rgba(0,0,0,0.2)',
35
-        borderRadius: '12px'
27
+        <span style={{ fontSize: '24px', color: '#fff' }}>总用户 </span>
28
+        <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}>133</span>
29
+      </div>
30
+      <div style={{
31
+        textAlign: 'center', display: 'flex', justifyContent: 'center', lineHeight: '100px', background: 'linear-gradient(144deg,rgba(255,126,74,1) 0%,rgba(255,196,168,1) 100%)', height: '100px',
32
+        boxShadow: '0px 18px 14px -15px rgba(255,126,74,1)',
33
+        borderRadius: '12px', width: '32%', marginRight: '2%'
36
       }}>
34
       }}>
37
-        <div className="gutter-box" style={{ textAlign: 'center' }}>
38
-          <p className="gutter-tit" style={{ fontSize: '24px', color: '#fff', margin: '24px 0 0 0 ' }}>总注册用户</p>
39
-          <p className="gutter-num" style={{ fontSize: '51px', color: '#fff', margin: '0' }}>76</p>
40
-        </div>
41
-      </Col>
42
-      <Col className="gutter-row" span={7} style={{
43
-        background: 'linear-gradient(180deg,rgba(77,231,247,1) 0%,rgba(89,49,238,1) 100%)', height: '150px',
44
-        boxShadow: '0px 1px 5px 1px rgba(0,0,0,0.2)',
45
-        borderRadius: '12px'
35
+        <span style={{ fontSize: '24px', color: '#fff' }}>总注册用户 </span>
36
+        <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}>12</span>
37
+      </div>
38
+      <div style={{
39
+        textAlign: 'center', display: 'flex', justifyContent: 'center', lineHeight: '100px', background: 'linear-gradient(137deg,rgba(107,130,230,1) 0%,rgba(152,175,251,1) 100%)', height: '100px',
40
+        boxShadow: '0px 18px 14px -15px rgba(107,130,230,1)',
41
+        borderRadius: '12px', width: '32%',
46
       }}>
42
       }}>
47
-        <div className="gutter-box" style={{ textAlign: 'center' }}>
48
-          <p className="gutter-tit" style={{ fontSize: '24px', color: '#fff', margin: '26px 0 0 0 ' }}>最近7天新增</p>
49
-          <p className="gutter-num" style={{ fontSize: '51px', color: '#fff', margin: '0' }}>24</p>
50
-        </div>
51
-      </Col>
52
-    </Row>
53
-  </div>
54
-
43
+        <span style={{ fontSize: '24px', color: '#fff' }}>最近7天新增 </span>
44
+        <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}>91</span>
45
+      </div>
46
+    </div>
47
+    <div>11111111111111</div>
48
+  </>
55
 );
49
 );

+ 48
- 33
src/pages/channel/InviteClients.jsx 查看文件

1
-import React from 'react';
1
+
2
+import React, { useState, useEffect } from 'react';
2
 import { Input, Menu, Dropdown, Button, Icon, message, Table, Divider, Tag, Select } from 'antd';
3
 import { Input, Menu, Dropdown, Button, Icon, message, Table, Divider, Tag, Select } from 'antd';
3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4
 import { FormattedMessage } from 'umi-plugin-react/locale';
4
 import channels from './channelList.less';
5
 import channels from './channelList.less';
5
 import router from 'umi/router';
6
 import router from 'umi/router';
7
+import request from '../../utils/request'
6
 
8
 
7
 const { Option } = Select;
9
 const { Option } = Select;
8
 function handleChange(value) {
10
 function handleChange(value) {
9
   console.log(`selected ${value}`);
11
   console.log(`selected ${value}`);
10
 }
12
 }
11
 
13
 
12
-
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 = [
14
 const dataSource = [
30
   {
15
   {
31
     key: '1',
16
     key: '1',
71
     align: 'center',
56
     align: 'center',
72
   },
57
   },
73
 ];
58
 ];
59
+const header = props => {
60
+  // eslint-disable-next-line react-hooks/rules-of-hooks
61
+  const [data, setData] = useState({ channelNmae: [], result: [] })
62
+  // eslint-disable-next-line react-hooks/rules-of-hooks
63
+  useEffect(() => {
64
+    getList({ pageNum: 1, pageSize: 10 })
65
+  }, [])
66
+
67
+  function getList(params) {
68
+    request({
69
+      url: '/api/admin/channel/InviteClientsList',
70
+      method: 'GET',
71
+      params: { ...params },
72
+  // eslint-disable-next-line no-shadow
73
+  }).then(data => {
74
+      console.log(data)
75
+      setData(data)
76
+  })
77
+  }
78
+  // value 的值
79
+  // eslint-disable-next-line no-shadow
80
+  function handleChange(value) {
81
+    // setQueryData({ ...queryData, channelId: value });
82
+    localStorage.setItem('value', value);
83
+  }
84
+  // 查询
85
+  function queryList() {
86
+    getList({ pageNum: 1, pageSize: 10 })
87
+  }
74
 
88
 
75
-// 跳转到编辑商品
76
-function toEditGoods() {
77
-  router.push({
78
-    pathname: '/channel/addChannel',
79
-    query: {
80
-      a: 'b',
81
-    },
82
-  });
83
-}
84
-export default () => (
85
-    <Table dataSource={dataSource} columns={columns} />
86
-);
87
 
89
 
88
-function handleMenuClick(e) {
89
-  message.info('Click on menu item.');
90
-  console.log('click', e);
90
+  // 分页
91
+  function onChange(pageNumber) {
92
+    // eslint-disable-next-line react-hooks/rules-of-hooks
93
+      getList({ pageNum: pageNumber, pageSize: 9 })
94
+  }
95
+
96
+  return (
97
+    <>
98
+      <div className={channels.searchBox}>
99
+      </div>
100
+      <Table dataSource={data.records} columns={columns} pagination={{ pageSize: 10, total: data.total, onChange }} />
101
+  </>
102
+  )
91
 }
103
 }
104
+
105
+
106
+export default header

+ 6
- 2
src/pages/channel/addChannel.jsx 查看文件

37
       if (!err) {
37
       if (!err) {
38
         console.log('Received values of form: ', values);
38
         console.log('Received values of form: ', values);
39
         // eslint-disable-next-line max-len
39
         // eslint-disable-next-line max-len
40
-        addChannel({ channelName: values.channelName, channelContact: values.channelContact, contactTel: values.contactTel })
40
+        addChannel({ channelName: values.channelName,
41
+                     channelContact: values.channelContact,
42
+                     contactTel: values.contactTel,
43
+                     explain: values.explain })
41
       }
44
       }
42
     });
45
     });
43
   }
46
   }
63
           })(<Input className={channels.inpuit} />)}
66
           })(<Input className={channels.inpuit} />)}
64
         </Form.Item>
67
         </Form.Item>
65
         <Form.Item label="说明描述">
68
         <Form.Item label="说明描述">
66
-       <TextArea className={channels.inpuitTxt} rows={8} />
69
+        {getFieldDecorator('explain', {
70
+        })(<TextArea className={channels.inpuitTxt} rows={8} />)}
67
         </Form.Item>
71
         </Form.Item>
68
         <Form.Item wrapperCol={{ span: 15, offset: 7 }}>
72
         <Form.Item wrapperCol={{ span: 15, offset: 7 }}>
69
           <Button type="primary" htmlType="submit">
73
           <Button type="primary" htmlType="submit">

+ 54
- 19
src/pages/channel/brokerList.jsx 查看文件

61
   },
61
   },
62
   {
62
   {
63
     title: '电话',
63
     title: '电话',
64
-    dataIndex: 'tel',
65
-    key: 'tel',
64
+    dataIndex: 'phone',
65
+    key: 'phone',
66
     align: 'center',
66
     align: 'center',
67
   },
67
   },
68
   {
68
   {
94
     },
94
     },
95
   });
95
   });
96
 }
96
 }
97
+
97
 const header = props => {
98
 const header = props => {
98
   // eslint-disable-next-line react-hooks/rules-of-hooks
99
   // eslint-disable-next-line react-hooks/rules-of-hooks
99
   const [data, setData] = useState({})
100
   const [data, setData] = useState({})
101
+
102
+  // eslint-disable-next-line react-hooks/rules-of-hooks
103
+  const [queryData, setQueryData] = useState({})
100
 //   const [page, changePage] = useState({})
104
 //   const [page, changePage] = useState({})
101
   // eslint-disable-next-line react-hooks/rules-of-hooks
105
   // eslint-disable-next-line react-hooks/rules-of-hooks
102
   useEffect(() => {
106
   useEffect(() => {
103
-    request({
107
+    getList()
108
+  }, [])
109
+      function getList(params) {
110
+      request({
104
         url: '/api/admin/channel/broker',
111
         url: '/api/admin/channel/broker',
105
         method: 'GET',
112
         method: 'GET',
106
-        params: { pageNum: 1, pageSize: 10 },
113
+        params: { ...params },
107
     // eslint-disable-next-line no-shadow
114
     // eslint-disable-next-line no-shadow
108
     }).then(data => {
115
     }).then(data => {
109
         console.log(data)
116
         console.log(data)
110
         setData(data)
117
         setData(data)
111
     })
118
     })
112
-  }, [])
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
+ function queryList() {
132
+  getList({ ...queryData, pageNum: 1, pageSize: 10, channelId: localStorage.getItem('value') })
133
+}
134
+    // 分页
135
+    function onChange(pageNumber) {
136
+      // eslint-disable-next-line react-hooks/rules-of-hooks
137
+        getList({ pageNum: pageNumber, pageSize: 10 })
138
+    }
139
+    // 获取input的值
140
+    function onInputChangePhone (e) {
141
+      // const InputValue = e.target.name.x.value;
142
+      setQueryData({ ...queryData, name: e.target.value })
143
+   }
113
 
144
 
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
-    })
145
+   function onInputChangeName (e) {
146
+    // const InputValue = e.target.name.x.value;
147
+    setQueryData({ ...queryData, phone: e.target.value })
148
+  }
149
+  function refurbishList () {
150
+    getList({ pageNum: 1, pageSize: 10 })
151
+  }
152
+  // eslint-disable-next-line no-undef
153
+  function handleClick() {
154
+    alert('11', this)
155
+    console.log('this is:', this);
123
   }
156
   }
124
-
125
 return (
157
 return (
126
   <>
158
   <>
127
     <div className={ channels.searchBox }>
159
     <div className={ channels.searchBox }>
128
       <div>
160
       <div>
129
         <span className={ channels.selectName }>姓名</span>
161
         <span className={ channels.selectName }>姓名</span>
130
-        <Input style ={{ width: 150 }} />
162
+        <Input onChange = { onInputChangePhone } style ={{ width: 150 }} />
131
         <span className={ channels.selectName }>电话</span>
163
         <span className={ channels.selectName }>电话</span>
132
-        <Input style ={{ width: 150 }}/>
164
+        <Input onChange = { onInputChangeName } style ={{ width: 150 }} />
133
       </div>
165
       </div>
134
-      <Button className={channels.about}>查询</Button>
166
+      <div>
167
+      <Button type="primary"  onClick={() => queryList() }>查询</Button>
168
+      <Button onClick={() => refurbishList() }>重置</Button>
169
+    </div>
135
     </div>
170
     </div>
136
-    <Table dataSource={data.records} columns={columns} />
171
+    <Table dataSource={data.records} columns={columns} pagination={{ pageSize: 10, total: data.total, onChange }} />
137
   </>
172
   </>
138
 )
173
 )
139
 }
174
 }

+ 34
- 11
src/pages/channel/channelList.jsx 查看文件

1
 import React, { useState, useEffect } from 'react';
1
 import React, { useState, useEffect } from 'react';
2
-import { Input, Menu, Dropdown, Button, Icon, message, Table, Divider, Tag, Select } from 'antd';
2
+import { Input, Menu, Dropdown, Button, Icon, message, Table, Divider, Tag, Select, Pagination } from 'antd';
3
 import { FormattedMessage } from 'umi-plugin-react/locale';
3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4
 import channels from './channelList.less';
4
 import channels from './channelList.less';
5
 import router from 'umi/router';
5
 import router from 'umi/router';
81
     dataIndex: '',
81
     dataIndex: '',
82
     key: '',
82
     key: '',
83
     align: 'center',
83
     align: 'center',
84
-    render: () => <a style={ { color: '#66B3FF' } }>编辑</a>,
84
+    render: (text, record) => <a style={ { color: '#66B3FF' } } onClick= {() => toedit(record.channelId)} >编辑</a>,
85
   },
85
   },
86
 ];
86
 ];
87
 
87
 
88
-// 跳转到编辑商品
89
-function toEditGoods() {
88
+// 跳转到添加页面
89
+function toAdd() {
90
   router.push({
90
   router.push({
91
     pathname: '/channel/addChannel',
91
     pathname: '/channel/addChannel',
92
     query: {
92
     query: {
94
     },
94
     },
95
   });
95
   });
96
 }
96
 }
97
+  // 跳编辑页面
98
+  function toedit(channelId) {
99
+    // alert(channelId)
100
+    router.push({
101
+      pathname: '/channel/editChannel',
102
+      query: {
103
+        id: channelId,
104
+      },
105
+    });
106
+  }
97
 
107
 
98
 const header = props => {
108
 const header = props => {
99
   // eslint-disable-next-line react-hooks/rules-of-hooks
109
   // eslint-disable-next-line react-hooks/rules-of-hooks
100
   const [data, setData] = useState({ channelNmae: [], result: [] })
110
   const [data, setData] = useState({ channelNmae: [], result: [] })
101
   // eslint-disable-next-line react-hooks/rules-of-hooks
111
   // 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(() => {
112
   useEffect(() => {
106
     getList({ pageNum: 1, pageSize: 10 })
113
     getList({ pageNum: 1, pageSize: 10 })
107
   }, [])
114
   }, [])
130
  function reset() {
137
  function reset() {
131
   getList({ pageNum: 1, pageSize: 10 })
138
   getList({ pageNum: 1, pageSize: 10 })
132
  }
139
  }
140
+
141
+ // 跳编辑页
142
+ function toEdit() {
143
+  router.push({
144
+    pathname: '/integralMall/editGoods',
145
+    query: {
146
+      a: 'b',
147
+    },
148
+  });
149
+}
150
+
151
+  // 分页
152
+  function onChange(pageNumber) {
153
+    // eslint-disable-next-line react-hooks/rules-of-hooks
154
+      getList({ pageNum: pageNumber, pageSize: 9 })
155
+  }
156
+
133
   return (
157
   return (
134
     <>
158
     <>
135
       <div className={channels.searchBox}>
159
       <div className={channels.searchBox}>
142
               )}
166
               )}
143
               {/* {listItems} */}
167
               {/* {listItems} */}
144
           </Select>
168
           </Select>
145
-
146
         </dvi>
169
         </dvi>
147
         <div >
170
         <div >
148
-        <Button style ={{ backgroundColor: '#00bfff' } } onClick={() => queryList() }>查询</Button>
171
+        <Button type="primary" onClick={() => queryList() }>查询</Button>
149
         <Button onClick={() => reset() }>重置</Button>
172
         <Button onClick={() => reset() }>重置</Button>
150
         </div>
173
         </div>
151
       </div>
174
       </div>
152
-      <Button className={channels.addBtn} onClick={toEditGoods}>新增</Button>
153
-      <Table dataSource={data.result.records} columns={columns} />
175
+      <Button type="danger" onClick={toAdd}>新增</Button>
176
+      <Table dataSource={data.result.records} columns={columns} pagination={{ pageSize: 10, total: data.result.total, onChange }} />
154
   </>
177
   </>
155
   )
178
   )
156
 }
179
 }

+ 1
- 1
src/pages/channel/channelList.less 查看文件

32
 .about {
32
 .about {
33
   padding: 0 30px;
33
   padding: 0 30px;
34
   height: 36px;
34
   height: 36px;
35
-  background-color: #00bfff;
35
+  background-color:rgba(255,255,255,1);
36
   color: #fff;
36
   color: #fff;
37
   margin: 30px 0;
37
   margin: 30px 0;
38
 }
38
 }

+ 89
- 0
src/pages/channel/editChannel.jsx 查看文件

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';
4
+import channels from './channelList.less';
5
+import router from 'umi/router';
6
+import request from '../../utils/request'
7
+
8
+const { TextArea } = Input;
9
+const { Option } = Select;
10
+
11
+const header = props => {
12
+
13
+  // eslint-disable-next-line react-hooks/rules-of-hooks
14
+  useEffect(() => {
15
+    getById()
16
+  }, [])
17
+  // 查询当前信息
18
+  function getById() {
19
+    request({
20
+      url: `/api/admin/channel/${props.location.query.id}`,
21
+      method: 'GET',
22
+  // eslint-disable-next-line no-shadow
23
+  }).then(data => {
24
+      props.form.setFieldsValue(data)
25
+  })
26
+  }
27
+
28
+  // 编辑
29
+  function editChannel(data) {
30
+    alert(1111111)
31
+      request({
32
+        url: `/api/admin/channel/${props.location.query.id}`,
33
+        method: 'PUT',
34
+        data: { ...data },
35
+    // eslint-disable-next-line no-shadow
36
+    }).then(data => {
37
+         // eslint-disable-next-line no-unused-expressions
38
+         router.go(-1)
39
+    })
40
+  }
41
+
42
+  function handleSubmit(e) {
43
+    e.preventDefault();
44
+    props.form.validateFields((err, values) => {
45
+      if (!err) {
46
+        console.log('values', values)
47
+        editChannel({ ...values })
48
+      }
49
+    });
50
+  }
51
+
52
+  const { getFieldDecorator } = props.form;
53
+
54
+  return (
55
+  <>
56
+        <Form labelCol={{ span: 7 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
57
+        <Form.Item label="渠道名称">
58
+          {getFieldDecorator('channelName', {
59
+            rules: [{ required: true, message: '请输入渠道名称' }],
60
+          })(<Input className={channels.inpuit} />)}
61
+        </Form.Item>
62
+        <Form.Item label="联系人">
63
+          {getFieldDecorator('channelContact', {
64
+            rules: [{ required: true, message: ' 请输入联系人' }],
65
+          })(<Input className={channels.inpuit} />)}
66
+        </Form.Item>
67
+        <Form.Item label="联系电话">
68
+          {getFieldDecorator('contactTel', {
69
+            rules: [{ required: true, message: '请输入联系电话' }],
70
+          })(<Input className={channels.inpuit} />)}
71
+        </Form.Item>
72
+        <Form.Item label="说明描述">
73
+        {getFieldDecorator('explain', {
74
+        })(<TextArea className={channels.inpuitTxt} rows={8} />)}
75
+        </Form.Item>
76
+        <Form.Item wrapperCol={{ span: 15, offset: 7 }}>
77
+          <Button type="primary" htmlType="submit">
78
+            保存
79
+          </Button>
80
+          <Button className={channels.formButton} onClick = {() => router.go(-1)} type="primary" htmlType="submit">
81
+            取消
82
+          </Button>
83
+        </Form.Item>
84
+      </Form>
85
+  </>
86
+)
87
+}
88
+const WrappedNormalLoginForm = Form.create({ name: 'header' })(header);
89
+export default WrappedNormalLoginForm

+ 17
- 18
src/pages/channel/recommendClients.jsx 查看文件

106
 //   const [page, changePage] = useState({})
106
 //   const [page, changePage] = useState({})
107
   // eslint-disable-next-line react-hooks/rules-of-hooks
107
   // eslint-disable-next-line react-hooks/rules-of-hooks
108
   useEffect(() => {
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
-    })
109
+    getList({ pageNumber: 1, pageSize: 10 })
118
   }, [])
110
   }, [])
119
 
111
 
120
-  const getList = e => {
112
+  function getList(params) {
121
     request({
113
     request({
122
-        url: '/api/xxx',
123
-        method: 'GET',
124
-        params: {},
125
-    // eslint-disable-next-line no-shadow
126
-    }).then(data => {
127
-        setData(data)
128
-    })
114
+      url: '/api/admin/customer/recommend/recommender',
115
+      method: 'GET',
116
+      params: { ...params },
117
+  // eslint-disable-next-line no-shadow
118
+  }).then(data => {
119
+      console.log(data)
120
+      setData(data)
121
+  })
129
   }
122
   }
130
 
123
 
124
+
125
+   // 分页
126
+ function onChange(pageNum) {
127
+      // eslint-disable-next-line react-hooks/rules-of-hooks
128
+        getList({ pageNumber: pageNum, pageSize: 9 })
129
+    }
131
 return (
130
 return (
132
   <>
131
   <>
133
-    <Table dataSource={data.records} columns={columns} />
132
+  <Table dataSource={data.records} columns={columns} pagination={{ pageSize: 10, total: data.total, onChange }} />
134
   </>
133
   </>
135
 )
134
 )
136
 }
135
 }

+ 1
- 1
src/pages/customer/report/index.jsx 查看文件

154
           )}
154
           )}
155
         </Form.Item>
155
         </Form.Item>
156
         <Form.Item>
156
         <Form.Item>
157
-          <Button type="primary" htmlType="submit" className={Styles.SubmitButton}>
157
+          <Button type="primary" htmlType="submit">
158
             搜索
158
             搜索
159
           </Button>
159
           </Button>
160
         </Form.Item>
160
         </Form.Item>

+ 1
- 17
src/pages/style/GoodsList.less 查看文件

1
 .addBtn {
1
 .addBtn {
2
   padding: 0 40px;
2
   padding: 0 40px;
3
   height: 36px;
3
   height: 36px;
4
-  background-color: #FF7E48;
5
-  color: #fff;
6
   margin: 30px 0;
4
   margin: 30px 0;
7
-  border-color: #FF7E48;
8
-}
9
-.addBtn:focus {
10
-  color: #fff;
11
-  background-color: #FF7E48;
12
-  border-color: #FF7E48;
13
-}
14
-.searchBtn{
15
- background-color: #EF273A;
16
- border-color: #EF273A;
17
-}
18
-.searchBtn:focus {
19
-  color: #fff;
20
-  background-color: #EF273A;
21
-  border-color: #EF273A;
22
 }
5
 }
6
+
23
 .touxiang {
7
 .touxiang {
24
   width: 93px;
8
   width: 93px;
25
   height: 93px;
9
   height: 93px;