소스 검색

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

魏熙美 5 년 전
부모
커밋
8c6f039d9f

+ 64
- 17
config/config.js 파일 보기

30
       // },
30
       // },
31
       pwa: pwa
31
       pwa: pwa
32
         ? {
32
         ? {
33
-            workboxPluginMode: 'InjectManifest',
34
-            workboxOptions: {
35
-              importWorkboxFrom: 'local',
36
-            },
37
-          }
33
+          workboxPluginMode: 'InjectManifest',
34
+          workboxOptions: {
35
+            importWorkboxFrom: 'local',
36
+          },
37
+        }
38
         : false, // default close dll, because issue https://github.com/ant-design/ant-design-pro/issues/4665
38
         : false, // default close dll, because issue https://github.com/ant-design/ant-design-pro/issues/4665
39
       // dll features https://webpack.js.org/plugins/dll-plugin/
39
       // dll features https://webpack.js.org/plugins/dll-plugin/
40
       // dll: {
40
       // dll: {
129
                 },
129
                 },
130
               ],
130
               ],
131
             },
131
             },
132
-            // {
133
-            //   path: '/welcome2',
134
-            //   name: '首页2',
135
-            //   component: '../layouts/BlankLayout',
136
-            //   routes:[
137
-            //     {
138
-            //       path: '/welcome3',
139
-            //       name: '首页3',
140
-            //       component: './Welcome',
141
-            //     },
142
-            //   ]
143
-            // },
144
             {
132
             {
145
               path: '/integralMall',
133
               path: '/integralMall',
146
               name: '积分商城',
134
               name: '积分商城',
151
                   name: '商品列表',
139
                   name: '商品列表',
152
                   component: './integralMall/GoodsList',
140
                   component: './integralMall/GoodsList',
153
                 },
141
                 },
142
+                {
143
+                  path: '/integralMall/editGoods',
144
+                  name: '',
145
+                  component: './integralMall/editGoods',
146
+                },
154
               ],
147
               ],
155
             },
148
             },
156
             {
149
             {
163
                   name: '渠道管理',
156
                   name: '渠道管理',
164
                   component: './channel/channelList',
157
                   component: './channel/channelList',
165
                 },
158
                 },
159
+                {
160
+                  path: '/channel/addChannel',
161
+                  name: '',
162
+                  component: './channel/addChannel',
163
+                },
164
+                {
165
+                  path: '/channel/brokerList',
166
+                  name: '经纪人',
167
+                  component: './channel/brokerList',
168
+                },
169
+                {
170
+                  path: '/channel/recommendClients',
171
+                  name: '推荐客户',
172
+                  component: './channel/recommendClients',
173
+                },
174
+                {
175
+                  path: '/channel/InviteClients',
176
+                  name: '邀请经纪人',
177
+                  component: './channel/InviteClients',
178
+                },
179
+              ],
180
+            },
181
+            {
182
+              path: '/news',
183
+              name: '资讯管理',
184
+              component: '../layouts/BlankLayout',
185
+              routes: [
186
+                {
187
+                  path: '/news/NewTypeList',
188
+                  name: '资讯列表',
189
+                  component: './news/NewTypeList',
190
+                },
191
+                {
192
+                  path: '/activity/editActivity',
193
+                  name: '',
194
+                  component: './activity/editActivity',
195
+                },
196
+              ],
197
+            },
198
+            {
199
+              path: '/activity',
200
+              name: '活动管理',
201
+              component: '../layouts/BlankLayout',
202
+              routes: [
203
+                {
204
+                  path: '/activity/ActivityList',
205
+                  name: '活动列表',
206
+                  component: './activity/ActivityList',
207
+                },
208
+                {
209
+                  path: '/activity/editActivity',
210
+                  name: '',
211
+                  component: './activity/editActivity',
212
+                },
166
               ],
213
               ],
167
             },
214
             },
168
             {
215
             {

+ 1
- 0
src/global.less 파일 보기

12
 
12
 
13
 .ant-layout {
13
 .ant-layout {
14
   min-height: 100vh;
14
   min-height: 100vh;
15
+  background-color: #f8f8f8;
15
 }
16
 }
16
 
17
 
17
 canvas {
18
 canvas {

+ 13
- 10
src/layouts/BlankLayout.jsx 파일 보기

1
 import React from 'react';
1
 import React from 'react';
2
+import { PageHeaderWrapper } from '@ant-design/pro-layout';
2
 
3
 
3
 const Layout = ({ children }) => (
4
 const Layout = ({ children }) => (
4
-  <div
5
-    style={{
6
-      backgroundColor: '#fff',
7
-      padding: '32PX 28px',
8
-      boxShadow: '0px 0px 16px 2px rgba(0,0,0,0.12)',
9
-      borderRadius: '12px',
10
-    }}
11
-  >
12
-    {children}
13
-  </div>
5
+  <PageHeaderWrapper style={{height:'49px',background:'rgba(240,240,240,1)',paddingTop:'15px'}}>
6
+    <div
7
+      style={{
8
+        backgroundColor: '#fff',
9
+        padding: '32PX 28px',
10
+        boxShadow: '0px 0px 16px 2px rgba(0,0,0,0.12)',
11
+        borderRadius: '12px',
12
+      }}
13
+    >
14
+      {children}
15
+    </div>
16
+  </PageHeaderWrapper>
14
 );
17
 );
15
 
18
 
16
 export default Layout;
19
 export default Layout;

+ 187
- 0
src/pages/activity/ActivityList.jsx 파일 보기

1
+import React from 'react';
2
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import styles from '../style/GoodsList.less';
5
+import router from 'umi/router';
6
+
7
+const { Option } = Select;
8
+// 提交事件
9
+function handleSubmit(e, props) {
10
+  e.preventDefault();
11
+  props.form.validateFields((err, values) => {
12
+    if (!err) {
13
+      console.log('提交数据: ', values)
14
+    }
15
+  });
16
+}
17
+// Change 事件
18
+function handleSelectChange(props) {
19
+  console.log(props)
20
+}
21
+
22
+// 分页
23
+function onChange(pageNumber) {
24
+  console.log('Page: ', pageNumber);
25
+}
26
+// 跳转到编辑商品
27
+function toEditGoods() {
28
+  router.push({
29
+    pathname: '/activity/editActivity',
30
+    query: {
31
+      a: 'b',
32
+    },
33
+  });
34
+}
35
+
36
+/**
37
+ *
38
+ *
39
+ * @param {*} props
40
+ * @returns
41
+ */
42
+
43
+const dataSource = [
44
+  {
45
+    key: '1',
46
+    img: 'http://img0.imgtn.bdimg.com/it/u=4246326797,2657995307&fm=26&gp=0.jpg',
47
+    name: '华为P30 Pro',
48
+  },
49
+  {
50
+    key: '2',
51
+    img: '',
52
+    name: '大米',
53
+  },
54
+];
55
+
56
+const columns = [
57
+  {
58
+    title: '商品图片',
59
+    dataIndex: 'img',
60
+    key: 'img',
61
+    align: 'center',
62
+    render: (text, record) => <img src={record.img} className={styles.touxiang} />,
63
+  },
64
+  {
65
+    title: '商品名称',
66
+    dataIndex: 'name',
67
+    key: 'name',
68
+    align: 'center',
69
+
70
+  },
71
+  {
72
+    title: '所属积分',
73
+    dataIndex: 'integral',
74
+    key: 'integral',
75
+    align: 'center',
76
+  },
77
+  {
78
+    title: '总数量',
79
+    dataIndex: 'total',
80
+    key: 'total',
81
+    align: 'center',
82
+  },
83
+  {
84
+    title: '已兑换数量',
85
+    dataIndex: 'exchanged',
86
+    key: 'exchanged',
87
+    align: 'center',
88
+  },
89
+  {
90
+    title: '剩余数量',
91
+    dataIndex: 'rest',
92
+    key: 'rest',
93
+    align: 'center',
94
+  },
95
+  {
96
+    title: '状态',
97
+    dataIndex: 'state',
98
+    key: 'state',
99
+    align: 'center',
100
+  },
101
+  {
102
+    title: '操作',
103
+    dataIndex: 'handle',
104
+    key: 'handle',
105
+    align: 'center',
106
+    render: () => <><span style={{ color: '#1990FF', marginRight: '20px' }} onClick={confirm}>下架<Icon type="shopping-cart" className={styles.shoppingCart} /></span><span style={{ color: '#FF925C' }}>编辑<Icon type="form" className={styles.edit} /></span></>,
107
+  },
108
+];
109
+const confirm = () => {
110
+  Modal.confirm({
111
+    title: '确认下架该商品?',
112
+    okText: '确认',
113
+    cancelText: '取消',
114
+    onOk() {
115
+      console.log('OK');
116
+    },
117
+    onCancel() {
118
+      console.log('Cancel');
119
+    },
120
+  });
121
+
122
+}
123
+
124
+const header = (props) => {
125
+  const { getFieldDecorator } = props.form
126
+  return (
127
+
128
+    <>
129
+      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
130
+        <Form.Item>
131
+          {getFieldDecorator('name')(
132
+            <Input
133
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
134
+              placeholder="商品名称"
135
+            />,
136
+          )}
137
+        </Form.Item>
138
+        <Form.Item>
139
+          {getFieldDecorator('goodState')(
140
+            <Select style={{ width: '180px' }} placeholder="状态" onChange={handleSelectChange}>
141
+              <Option value="1">上架</Option>
142
+              <Option value="0">下架</Option>
143
+            </Select>,
144
+          )}
145
+        </Form.Item>
146
+        <Form.Item>
147
+          {getFieldDecorator('isMain')(
148
+            <Select style={{ width: '180px' }} placeholder="所属项目" onChange={handleSelectChange}>
149
+              <Option value="1">首页推荐</Option>
150
+              <Option value="0">首页未推荐</Option>
151
+            </Select>,
152
+          )}
153
+        </Form.Item>
154
+        <Form.Item>
155
+          {getFieldDecorator('min')(
156
+            <Input
157
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
158
+              placeholder="最小积分"
159
+            />,
160
+          )}
161
+        </Form.Item>
162
+        <Form.Item>
163
+          {getFieldDecorator('max')(
164
+            <Input
165
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
166
+              placeholder="最大积分"
167
+            />,
168
+          )}
169
+        </Form.Item>
170
+        <Form.Item>
171
+          <Button type="primary" htmlType="submit" className={styles.searchBtn}>
172
+            搜索
173
+          </Button>
174
+        </Form.Item>
175
+      </Form>
176
+      <Button type="primary" className={styles.addBtn} onClick={toEditGoods}>新增</Button>
177
+      <Table dataSource={dataSource} columns={columns} />
178
+      {/* 分页 */
179
+      /* <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
180
+        <Pagination showQuickJumper defaultCurrent={1} total={500} onChange={onChange} />
181
+      </div> */}
182
+    </>
183
+  )
184
+}
185
+const WrappedHeader = Form.create({ name: 'header' })(header);
186
+
187
+export default WrappedHeader

+ 52
- 0
src/pages/activity/editActivity.jsx 파일 보기

1
+import React, { useState } from 'react';
2
+import { Form, Input, Button, Icon, Select, Tabs, Radio } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import styles from '../style/GoodsList.less';
5
+
6
+
7
+
8
+/**
9
+ *
10
+ *
11
+ * @param {*} props
12
+ * @returns
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
+ const Edit = (props) => {
29
+   const [ tab, changeTab ] = useState('a');
30
+
31
+
32
+  return (
33
+    <div>
34
+      <div>
35
+        <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>
39
+        </Radio.Group>
40
+      </div>
41
+      <div>
42
+        { tab === 'a' && <Basic /> }
43
+        { tab === 'b' && <Poster /> }
44
+        { tab === 'c' && <Share /> }
45
+      </div>
46
+    </div>
47
+  );
48
+ }
49
+
50
+
51
+
52
+export default Edit

+ 20
- 1
src/pages/channel/channelList.jsx 파일 보기

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 } 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
 
6
 
6
 const { Option } = Select;
7
 const { Option } = Select;
7
 function handleChange(value) {
8
 function handleChange(value) {
8
   console.log(`selected ${value}`);
9
   console.log(`selected ${value}`);
9
 }
10
 }
11
+
12
+
10
 const menu = (
13
 const menu = (
11
   <Menu onClick={handleMenuClick}>
14
   <Menu onClick={handleMenuClick}>
12
     <Menu.Item key="1">
15
     <Menu.Item key="1">
92
     align: 'center',
95
     align: 'center',
93
     render: () => <a>Delete</a>,
96
     render: () => <a>Delete</a>,
94
   },
97
   },
98
+  {
99
+    title: '操作',
100
+    dataIndex: 'handle',
101
+    key: 'handle',
102
+    align: 'center',
103
+    render: () => <a style={ { color: '#66B3FF' } }>编辑</a>,
104
+  },
95
 ];
105
 ];
96
 
106
 
107
+// 跳转到编辑商品
108
+function toEditGoods() {
109
+  router.push({
110
+    pathname: '/channel/addChannel',
111
+    query: {
112
+      a: 'b',
113
+    },
114
+  });
115
+}
97
 export default () => (
116
 export default () => (
98
   <>
117
   <>
99
     <div className={channels.searchBox}>
118
     <div className={channels.searchBox}>
110
       </dvi>
129
       </dvi>
111
       <Button className={channels.about}>查询</Button>
130
       <Button className={channels.about}>查询</Button>
112
     </div>
131
     </div>
113
-    <Button className={channels.addBtn}>新增</Button>
132
+    <Button className={channels.addBtn} onClick={toEditGoods}>新增</Button>
114
     <Table dataSource={dataSource} columns={columns} />
133
     <Table dataSource={dataSource} columns={columns} />
115
   </>
134
   </>
116
 );
135
 );

+ 19
- 1
src/pages/channel/channelList.less 파일 보기

1
 .searchBox {
1
 .searchBox {
2
-  font-size: 30px;
2
+  font-size: 20px;
3
   color: red;
3
   color: red;
4
   display: flex;
4
   display: flex;
5
   display: flex;
5
   display: flex;
44
   color: rgb(10, 10, 10);
44
   color: rgb(10, 10, 10);
45
   margin: 30px 0;
45
   margin: 30px 0;
46
 }
46
 }
47
+
48
+.inpuit {
49
+  width:50%;
50
+}
51
+
52
+.inpuitTxt {
53
+  width:70%;
54
+}
55
+
56
+
57
+.formButton{
58
+  margin-left: 12% 
59
+}
60
+
61
+.divInput{
62
+  float: 'left'; 
63
+  width: 500
64
+}

+ 99
- 79
src/pages/integralMall/GoodsList.jsx 파일 보기

1
 import React from 'react';
1
 import React from 'react';
2
-import { Input, Menu, Dropdown, Button, Icon, message, Table, Divider, Tag, Pagination, Modal } from 'antd';
2
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal,Breadcrumb } from 'antd';
3
 import { FormattedMessage } from 'umi-plugin-react/locale';
3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4
 import styles from '../style/GoodsList.less';
4
 import styles from '../style/GoodsList.less';
5
+import router from 'umi/router';
5
 
6
 
6
-class StateDropdown extends React.Component {
7
-  state = {
8
-    goodState: '状态',
9
-  }
10
-
11
-  render() {
12
-
13
-    const menu = (
14
-      <Menu onClick={this.handleMenuClick}>
15
-        <Menu.Item key="1">
16
-          上架
17
-        </Menu.Item>
18
-        <Menu.Item key="2">
19
-          下架
20
-        </Menu.Item>
21
-      </Menu>
22
-    );
23
-    return (
24
-      < Dropdown overlay={menu} className={styles.searchItem} >
25
-        <Button>
26
-          {this.state.goodState} <Icon type="down" />
27
-        </Button>
28
-      </Dropdown>
29
-    )
30
-  }
31
-  handleMenuClick = e => {
32
-    this.setState({
33
-      goodState: e.item.props.children,
34
-    });
35
-
36
-  }
37
-};
38
-class App extends React.Component {
39
-  state = {
40
-    good: '请选择',
41
-  }
7
+const { Option } = Select;
8
+// 提交事件
9
+function handleSubmit(e, props) {
10
+  e.preventDefault();
11
+  props.form.validateFields((err, values) => {
12
+    if (!err) {
13
+      console.log('提交数据: ', values)
14
+    }
15
+  });
16
+}
17
+// Change 事件
18
+function handleSelectChange(props) {
19
+  console.log(props)
20
+}
42
 
21
 
43
-  render() {
22
+// 分页
23
+function onChange(pageNumber) {
24
+  console.log('Page: ', pageNumber);
25
+}
26
+// 跳转到编辑商品
27
+function toEditGoods() {
28
+  router.push({
29
+    pathname: '/integralMall/editGoods',
30
+    query: {
31
+      a: 'b',
32
+    },
33
+  });
34
+}
44
 
35
 
45
-    const menu = (
46
-      <Menu onClick={this.handleMenuClick}>
47
-        <Menu.Item key="1">
48
-          上架2
49
-        </Menu.Item>
50
-        <Menu.Item key="2">
51
-          下架2
52
-        </Menu.Item>
53
-      </Menu>
54
-    );
55
-    return (
56
-      < Dropdown overlay={menu} className={styles.searchItem} >
57
-        <Button>
58
-          {this.state.good} <Icon type="down" />
59
-        </Button>
60
-      </Dropdown>
61
-    )
62
-  }
63
-  handleMenuClick = e => {
64
-    this.setState({
65
-      good: e.item.props.children,
66
-    });
36
+/**
37
+ *
38
+ *
39
+ * @param {*} props
40
+ * @returns
41
+ */
67
 
42
 
68
-  }
69
-};
70
 const dataSource = [
43
 const dataSource = [
71
   {
44
   {
72
     key: '1',
45
     key: '1',
130
     dataIndex: 'handle',
103
     dataIndex: 'handle',
131
     key: 'handle',
104
     key: 'handle',
132
     align: 'center',
105
     align: 'center',
133
-    render: () => <><span style={{ color: '#1990FF', marginRight: '20px' }} onClick={confirm}>下架<Icon type="shopping-cart" className={styles.shoppingCart} /></span><span style={{ color: '#FF925C' }}>编辑<Icon type="form" className={styles.edit} /></span></>,
106
+    render: () => <><span style={{ color: '#1990FF', marginRight: '20px' }} onClick={confirm}>下架<Icon type="shopping-cart" className={styles.shoppingCart} /></span><span style={{ color: '#FF925C' }} onClick={toEditGoods}>编辑<Icon type="form" className={styles.edit} /></span></>,
134
   },
107
   },
135
 ];
108
 ];
136
 function confirm() {
109
 function confirm() {
147
   });
120
   });
148
 
121
 
149
 }
122
 }
150
-export default () => (
151
-  <>
152
-    <div className={styles.searchBox}>
153
-      <Input placeholder="商品名称" className={styles.searchItem} />
154
-      <StateDropdown />
155
-      <App />
156
-      <Input placeholder="最小积分" className={styles.searchItem} />
157
-      <Input placeholder="最大积分" className={styles.searchItem} />
158
-      <Button type="primary" className={styles.searchBtn}>
159
-        查询
160
-      </Button>
161
-    </div>
162
-    <Button type="primary" className={styles.addBtn}>新增</Button>
163
-    <Table dataSource={dataSource} columns={columns} />
123
+function header(props) {
124
+  const { getFieldDecorator } = props.form
125
+  return (
126
+
127
+    <>
128
+      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
129
+        <Form.Item>
130
+          {getFieldDecorator('name')(
131
+            <Input
132
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
133
+              placeholder="商品名称"
134
+            />,
135
+          )}
136
+        </Form.Item>
137
+        <Form.Item>
138
+          {getFieldDecorator('goodState')(
139
+            <Select style={{ width: '180px' }} placeholder="状态" onChange={handleSelectChange}>
140
+              <Option value="1">上架</Option>
141
+              <Option value="0">下架</Option>
142
+            </Select>,
143
+          )}
144
+        </Form.Item>
145
+        <Form.Item>
146
+          {getFieldDecorator('isMain')(
147
+            <Select style={{ width: '180px' }} placeholder="所属项目" onChange={handleSelectChange}>
148
+              <Option value="1">首页推荐</Option>
149
+              <Option value="0">首页未推荐</Option>
150
+            </Select>,
151
+          )}
152
+        </Form.Item>
153
+        <Form.Item>
154
+          {getFieldDecorator('min')(
155
+            <Input
156
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
157
+              placeholder="最小积分"
158
+            />,
159
+          )}
160
+        </Form.Item>
161
+        <Form.Item>
162
+          {getFieldDecorator('max')(
163
+            <Input
164
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
165
+              placeholder="最大积分"
166
+            />,
167
+          )}
168
+        </Form.Item>
169
+        <Form.Item>
170
+          <Button type="primary" htmlType="submit" className={styles.searchBtn}>
171
+            搜索
172
+          </Button>
173
+        </Form.Item>
174
+      </Form>
175
+      <Button type="primary" className={styles.addBtn} onClick={toEditGoods}>新增</Button>
176
+      <Table dataSource={dataSource} columns={columns} />
177
+      {/* 分页 */
178
+      /* <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
179
+        <Pagination showQuickJumper defaultCurrent={1} total={500} onChange={onChange} />
180
+      </div> */}
181
+    </>
182
+  )
183
+}
184
+const WrappedHeader = Form.create({ name: 'header' })(header);
164
 
185
 
165
-  </>
166
-);
186
+export default WrappedHeader

+ 27
- 0
src/pages/integralMall/editGoods.jsx 파일 보기

1
+import React from 'react';
2
+import { Form, Input, Button, Icon, Select } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import styles from '../style/GoodsList.less';
5
+
6
+
7
+
8
+/**
9
+ *
10
+ *
11
+ * @param {*} props
12
+ * @returns
13
+ */
14
+
15
+
16
+function header(props) {
17
+  const { getFieldDecorator } = props.form
18
+  return (
19
+
20
+    <>
21
+     <div>编辑商品</div>
22
+    </>
23
+  )
24
+}
25
+const WrappedHeader = Form.create({ name: 'header' })(header);
26
+
27
+export default WrappedHeader

+ 119
- 0
src/pages/news/NewTypeList.jsx 파일 보기

1
+import React from 'react';
2
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import styles from '../style/GoodsList.less';
5
+import router from 'umi/router';
6
+
7
+const { Option } = Select;
8
+// 提交事件
9
+function handleSubmit(e, props) {
10
+  e.preventDefault();
11
+  props.form.validateFields((err, values) => {
12
+    if (!err) {
13
+      console.log('提交数据: ', values)
14
+    }
15
+  });
16
+}
17
+// Change 事件
18
+function handleSelectChange(props) {
19
+  console.log(props)
20
+}
21
+
22
+// 分页
23
+function onChange(pageNumber) {
24
+  console.log('Page: ', pageNumber);
25
+}
26
+// 跳转到编辑商品
27
+function toEditGoods() {
28
+  router.push({
29
+    pathname: '/activity/editActivity',
30
+    query: {
31
+      a: 'b',
32
+    },
33
+  });
34
+}
35
+
36
+/**
37
+ *
38
+ *
39
+ * @param {*} props
40
+ * @returns
41
+ */
42
+
43
+const dataSource = [
44
+  {
45
+    key: '1',
46
+    img: 'http://img0.imgtn.bdimg.com/it/u=4246326797,2657995307&fm=26&gp=0.jpg',
47
+    name: '华为P30 Pro',
48
+  },
49
+  {
50
+    key: '2',
51
+    img: '',
52
+    name: '大米',
53
+  },
54
+];
55
+
56
+const columns = [
57
+  {
58
+    title: '类型图',
59
+    dataIndex: 'img',
60
+    key: 'img',
61
+    align: 'center',
62
+    render: (text, record) => <img src={record.img} className={styles.touxiang} />,
63
+  },
64
+  {
65
+    title: '名称',
66
+    dataIndex: 'name',
67
+    key: 'name',
68
+    align: 'center',
69
+
70
+  },
71
+
72
+  {
73
+    title: '操作',
74
+    dataIndex: 'handle',
75
+    key: 'handle',
76
+    align: 'center',
77
+    render: () => <>
78
+    <span style={{ color: '#1990FF', marginRight: '20px' }} onClick={confirm}>删除<Icon type="shopping-cart" className={styles.shoppingCart} /></span>
79
+    <span style={{ color: '#FF925C' }}>编辑<Icon type="form" className={styles.edit} /></span></>,
80
+  },
81
+];
82
+const confirm = () => {
83
+  Modal.confirm({
84
+    title: '确认删除该商品?',
85
+    okText: '确认',
86
+    cancelText: '取消',
87
+    onOk() {
88
+      console.log('OK');
89
+    },
90
+    onCancel() {
91
+      console.log('Cancel');
92
+    },
93
+  });
94
+
95
+}
96
+
97
+const header = (props) => {
98
+  const { getFieldDecorator } = props.form
99
+  return (
100
+
101
+    <>
102
+      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
103
+        <Form.Item>
104
+          {getFieldDecorator('goodState')(
105
+            <Select style={{ width: '180px' }} placeholder="请选择" onChange={handleSelectChange}>
106
+              <Option value="1">上架</Option>
107
+              <Option value="0">下架</Option>
108
+            </Select>,
109
+          )}
110
+        </Form.Item>
111
+      </Form>
112
+      <Button type="primary" className={styles.addBtn} onClick={toEditGoods}>新增</Button>
113
+      <Table dataSource={dataSource} columns={columns} />
114
+    </>
115
+  )
116
+}
117
+const WrappedHeader = Form.create({ name: 'header' })(header);
118
+
119
+export default WrappedHeader

+ 0
- 17
src/pages/style/GoodsList.less 파일 보기

1
-.searchBox {
2
-  font-size: 30px;
3
-  color: red;
4
-  display: flex;
5
-  display: flex;
6
-  justify-items: center;
7
-  align-items: center;
8
-  justify-content: space-between;
9
-  .searchItem {
10
-    min-width: 200px;
11
-    margin-right: 20px;
12
-    text-align: left;
13
-    .anticon-down {
14
-      float: right !important;
15
-    }
16
-  }
17
-}
18
 .addBtn {
1
 .addBtn {
19
   padding: 0 30px;
2
   padding: 0 30px;
20
   height: 36px;
3
   height: 36px;

+ 56
- 0
src/pages/style/News.less 파일 보기

1
+.searchBox {
2
+    font-size: 30px;
3
+    color: red;
4
+    display: flex;
5
+    display: flex;
6
+    justify-items: center;
7
+    align-items: center;
8
+    justify-content: space-between;
9
+    .searchItem {
10
+      min-width: 200px;
11
+      margin-right: 20px;
12
+      text-align: left;
13
+      .anticon-down {
14
+        float: right !important;
15
+      }
16
+    }
17
+  }
18
+  .addBtn {
19
+    padding: 0 30px;
20
+    height: 36px;
21
+    background-color: #50be00;
22
+    color: #fff;
23
+    margin: 30px 0;
24
+    border-color: #50be00;
25
+  }
26
+  .addBtn:focus {
27
+    color: #fff;
28
+    background-color: #50be00;
29
+    border-color: #50be00;
30
+  }
31
+  .searchBtn{
32
+   background-color: #3A91D5;
33
+   border-color: #3A91D5;
34
+  }
35
+  .searchBtn:focus {
36
+    color: #fff;
37
+    background-color: #3A91D5;
38
+    border-color: #3A91D5;
39
+  }
40
+  .touxiang {
41
+    width: 93px;
42
+    height: 93px;
43
+  }
44
+  .ant-table-column-title {
45
+    font-weight: 600;
46
+  }
47
+  .shoppingCart{
48
+    color: #dcdcdc;
49
+    margin-left: 6px;
50
+    font-size: 16px;
51
+  }
52
+  .edit{
53
+    color: #dcdcdc;
54
+    margin-left: 6px;
55
+    font-size: 15px;
56
+  }