소스 검색

解决冲突

魏熙美 5 년 전
부모
커밋
88a357f7b9
6개의 변경된 파일179개의 추가작업 그리고 12개의 파일을 삭제
  1. 12
    0
      config/config.js
  2. 0
    5
      package.json
  3. 12
    1
      src/layouts/BlankLayout.jsx
  4. 4
    6
      src/pages/building/list/index.jsx
  5. 120
    0
      src/pages/integralMall/GoodsList.jsx
  6. 31
    0
      src/pages/style/GoodsList.less

+ 12
- 0
config/config.js 파일 보기

@@ -136,6 +136,18 @@ export default {
136 136
             //     },
137 137
             //   ]
138 138
             // },
139
+            {
140
+              path: '/integralMall',
141
+              name: '积分商城',
142
+              component: '../layouts/BlankLayout',
143
+              routes: [
144
+                {
145
+                  path: '/integralMall/GoodsList',
146
+                  name: '商品列表',
147
+                  component: './integralMall/GoodsList',
148
+                },
149
+              ],
150
+            },
139 151
             {
140 152
               component: './404',
141 153
             },

+ 0
- 5
package.json 파일 보기

@@ -26,11 +26,6 @@
26 26
     "test:component": "umi test ./src/components",
27 27
     "ui": "umi ui"
28 28
   },
29
-  "husky": {
30
-    "hooks": {
31
-      "pre-commit": "npm run lint-staged"
32
-    }
33
-  },
34 29
   "lint-staged": {
35 30
     "**/*.less": "stylelint --syntax less",
36 31
     "**/*.{js,jsx,tsx,ts,less,md,json}": [

+ 12
- 1
src/layouts/BlankLayout.jsx 파일 보기

@@ -1,5 +1,16 @@
1 1
 import React from 'react';
2 2
 
3
-const Layout = ({ children }) => <div>{children}</div>;
3
+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>
14
+);
4 15
 
5 16
 export default Layout;

+ 4
- 6
src/pages/building/list/index.jsx 파일 보기

@@ -4,18 +4,16 @@ import Styles from './style.less';
4 4
 
5 5
 const { Option } = Select;
6 6
 
7
-// 校验错误
8
-function hasErrors(fieldsError) {
9
-  return Object.keys(fieldsError).some(field => fieldsError[field]);
10
-}
11
-
12 7
 // 提交事件
13 8
 function handleSubmit(e, props) {
9
+  console.log(props)
14 10
   e.preventDefault();
15 11
 }
16 12
 
17 13
 // Change 事件
18
-function handleSelectChange(props) {}
14
+function handleSelectChange(props) {
15
+  console.log(props)
16
+}
19 17
 
20 18
 // 搜索
21 19
 function header(props) {

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