|
@@ -0,0 +1,120 @@
|
|
1
|
+import React from 'react';
|
|
2
|
+import { Input, Menu, Dropdown, Button, Icon, message, Table, Divider, Tag } from 'antd';
|
|
3
|
+import { FormattedMessage } from 'umi-plugin-react/locale';
|
|
4
|
+import styles from '../style/GoodsList.less';
|
|
5
|
+const menu = (
|
|
6
|
+ <Menu onClick={handleMenuClick}>
|
|
7
|
+ <Menu.Item key="1">
|
|
8
|
+ <Icon type="user" />
|
|
9
|
+ 1st menu item
|
|
10
|
+ </Menu.Item>
|
|
11
|
+ <Menu.Item key="2">
|
|
12
|
+ <Icon type="user" />
|
|
13
|
+ 2nd menu item
|
|
14
|
+ </Menu.Item>
|
|
15
|
+ <Menu.Item key="3">
|
|
16
|
+ <Icon type="user" />
|
|
17
|
+ 3rd item
|
|
18
|
+ </Menu.Item>
|
|
19
|
+ </Menu>
|
|
20
|
+);
|
|
21
|
+const dataSource = [
|
|
22
|
+ {
|
|
23
|
+ key: '1',
|
|
24
|
+ img: 'http://img0.imgtn.bdimg.com/it/u=4246326797,2657995307&fm=26&gp=0.jpg',
|
|
25
|
+ name: '123',
|
|
26
|
+ age: 32,
|
|
27
|
+ address: '西湖区湖底公园1号',
|
|
28
|
+ },
|
|
29
|
+ {
|
|
30
|
+ key: '2',
|
|
31
|
+ img: '',
|
|
32
|
+ age: 42,
|
|
33
|
+ address: '西湖区湖底公园1号',
|
|
34
|
+ },
|
|
35
|
+];
|
|
36
|
+
|
|
37
|
+const columns = [
|
|
38
|
+ {
|
|
39
|
+ title: '商品图片',
|
|
40
|
+ dataIndex: 'img',
|
|
41
|
+ key: 'img',
|
|
42
|
+ align: 'center',
|
|
43
|
+
|
|
44
|
+ render: (text, record) => <img src={record.img} className={styles.touxiang} />,
|
|
45
|
+ },
|
|
46
|
+ {
|
|
47
|
+ title: '商品名称',
|
|
48
|
+ dataIndex: 'name',
|
|
49
|
+ key: 'name',
|
|
50
|
+ align: 'center',
|
|
51
|
+ render: text => <a>{text}</a>,
|
|
52
|
+ },
|
|
53
|
+ {
|
|
54
|
+ title: '所属积分',
|
|
55
|
+ dataIndex: 'integral',
|
|
56
|
+ key: 'integral',
|
|
57
|
+ align: 'center',
|
|
58
|
+ },
|
|
59
|
+ {
|
|
60
|
+ title: '总数量',
|
|
61
|
+ dataIndex: 'total',
|
|
62
|
+ key: 'total',
|
|
63
|
+ align: 'center',
|
|
64
|
+ },
|
|
65
|
+ {
|
|
66
|
+ title: '已兑换数量',
|
|
67
|
+ dataIndex: 'exchanged',
|
|
68
|
+ key: 'exchanged',
|
|
69
|
+ align: 'center',
|
|
70
|
+ },
|
|
71
|
+ {
|
|
72
|
+ title: '剩余数量',
|
|
73
|
+ dataIndex: 'rest',
|
|
74
|
+ key: 'rest',
|
|
75
|
+ align: 'center',
|
|
76
|
+ },
|
|
77
|
+ {
|
|
78
|
+ title: '状态',
|
|
79
|
+ dataIndex: 'state',
|
|
80
|
+ key: 'state',
|
|
81
|
+ align: 'center',
|
|
82
|
+ },
|
|
83
|
+ {
|
|
84
|
+ title: '操作',
|
|
85
|
+ dataIndex: 'handle',
|
|
86
|
+ key: 'handle',
|
|
87
|
+ align: 'center',
|
|
88
|
+ render: () => <a>Delete</a>,
|
|
89
|
+ },
|
|
90
|
+];
|
|
91
|
+
|
|
92
|
+export default () => (
|
|
93
|
+ <>
|
|
94
|
+ <div className={styles.searchBox}>
|
|
95
|
+ <Input placeholder="商品名称" className={styles.searchItem} />
|
|
96
|
+ <Dropdown overlay={menu} className={styles.searchItem}>
|
|
97
|
+ <Button>
|
|
98
|
+ Button <Icon type="down" />
|
|
99
|
+ </Button>
|
|
100
|
+ </Dropdown>
|
|
101
|
+ <Dropdown overlay={menu} className={styles.searchItem}>
|
|
102
|
+ <Button>
|
|
103
|
+ Button <Icon type="down" />
|
|
104
|
+ </Button>
|
|
105
|
+ </Dropdown>
|
|
106
|
+ <Input placeholder="商品名称" className={styles.searchItem} />
|
|
107
|
+ <Input placeholder="商品名称" className={styles.searchItem} />
|
|
108
|
+ <Button type="primary" size="small">
|
|
109
|
+ 查询
|
|
110
|
+ </Button>
|
|
111
|
+ </div>
|
|
112
|
+ <Button className={styles.addBtn}>新增</Button>
|
|
113
|
+ <Table dataSource={dataSource} columns={columns} />
|
|
114
|
+ </>
|
|
115
|
+);
|
|
116
|
+
|
|
117
|
+function handleMenuClick(e) {
|
|
118
|
+ message.info('Click on menu item.');
|
|
119
|
+ console.log('click', e);
|
|
120
|
+}
|