许静 5 年之前
父節點
當前提交
55b24f4487
共有 2 個檔案被更改,包括 151 行新增0 行删除
  1. 120
    0
      src/pages/integralMall/GoodsList.jsx
  2. 31
    0
      src/pages/style/GoodsList.less

+ 120
- 0
src/pages/integralMall/GoodsList.jsx 查看文件

@@ -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
+}

+ 31
- 0
src/pages/style/GoodsList.less 查看文件

@@ -0,0 +1,31 @@
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
+}
25
+.touxiang {
26
+  width: 93px;
27
+  height: 93px;
28
+}
29
+.ant-table-column-title {
30
+  font-weight: 600;
31
+}