Selaa lähdekoodia

渠道管理页

dingxin 5 vuotta sitten
vanhempi
commit
d601e98d78
4 muutettua tiedostoa jossa 199 lisäystä ja 5 poistoa
  1. 12
    0
      config/config.js
  2. 20
    5
      package.json
  3. 121
    0
      src/pages/channel/channelList.jsx
  4. 46
    0
      src/pages/channel/channelList.less

+ 12
- 0
config/config.js Näytä tiedosto

@@ -124,6 +124,18 @@ export default {
124 124
                 },
125 125
               ],
126 126
             },
127
+            {
128
+              path: '/channel',
129
+              name: '渠道管理',
130
+              component: '../layouts/BlankLayout',
131
+              routes: [
132
+                {
133
+                  path: '/channel/channelList',
134
+                  name: '渠道管理',
135
+                  component: './channel/channelList',
136
+                },
137
+              ],
138
+            },
127 139
             {
128 140
               component: './404',
129 141
             },

+ 20
- 5
package.json Näytä tiedosto

@@ -26,14 +26,25 @@
26 26
     "test:component": "umi test ./src/components",
27 27
     "ui": "umi ui"
28 28
   },
29
-  "husky": { "hooks": { "pre-commit": "npm run lint-staged" } },
29
+  "husky": {
30
+    "hooks": {
31
+      "pre-commit": "npm run lint-staged"
32
+    }
33
+  },
30 34
   "lint-staged": {
31 35
     "**/*.less": "stylelint --syntax less",
32
-    "**/*.{js,jsx,tsx,ts,less,md,json}": ["prettier --write", "git add"],
36
+    "**/*.{js,jsx,tsx,ts,less,md,json}": [
37
+      "prettier --write",
38
+      "git add"
39
+    ],
33 40
     "**/*.{js,jsx}": "npm run lint-staged:js",
34 41
     "**/*.{js,ts,tsx}": "npm run lint-staged:js"
35 42
   },
36
-  "browserslist": ["> 1%", "last 2 versions", "not ie <= 10"],
43
+  "browserslist": [
44
+    "> 1%",
45
+    "last 2 versions",
46
+    "not ie <= 10"
47
+  ],
37 48
   "dependencies": {
38 49
     "@ant-design/pro-layout": "^4.5.9",
39 50
     "@antv/data-set": "^0.10.2",
@@ -94,8 +105,12 @@
94 105
     "umi-types": "^0.3.8",
95 106
     "webpack-theme-color-replacer": "^1.2.15"
96 107
   },
97
-  "optionalDependencies": { "puppeteer": "^1.17.0" },
98
-  "engines": { "node": ">=10.0.0" },
108
+  "optionalDependencies": {
109
+    "puppeteer": "^1.17.0"
110
+  },
111
+  "engines": {
112
+    "node": ">=10.0.0"
113
+  },
99 114
   "checkFiles": [
100 115
     "src/**/*.js*",
101 116
     "src/**/*.ts*",

+ 121
- 0
src/pages/channel/channelList.jsx Näytä tiedosto

@@ -0,0 +1,121 @@
1
+import React from 'react';
2
+import { Input, Menu, Dropdown, Button, Icon, message, Table, Divider, Tag, Select } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import channels from './channelList.less';
5
+
6
+const { Option } = Select;
7
+function handleChange(value) {
8
+  console.log(`selected ${value}`);
9
+}
10
+const menu = (
11
+  <Menu onClick={handleMenuClick}>
12
+    <Menu.Item key="1">
13
+      <Icon type="user" />
14
+      1st menu item
15
+    </Menu.Item>
16
+    <Menu.Item key="2">
17
+      <Icon type="user" />
18
+      2nd menu item
19
+    </Menu.Item>
20
+    <Menu.Item key="3">
21
+      <Icon type="user" />
22
+      3rd item
23
+    </Menu.Item>
24
+  </Menu>
25
+);
26
+const dataSource = [
27
+  {
28
+    key: '1',
29
+    img: 'http://img0.imgtn.bdimg.com/it/u=4246326797,2657995307&fm=26&gp=0.jpg',
30
+    name: '123',
31
+    age: 32,
32
+    address: '西湖区湖底公园1号',
33
+  },
34
+  {
35
+    key: '2',
36
+    img: '',
37
+    age: 42,
38
+    address: '西湖区湖底公园1号',
39
+  },
40
+];
41
+
42
+const columns = [
43
+  // {
44
+  //   title: '商品图片',
45
+  //   dataIndex: 'img',
46
+  //   key: 'img',
47
+  //   align: 'center',
48
+
49
+  //   render: (text, record) => <img src={record.img} className={channels.touxiang} />,
50
+  // },
51
+  {
52
+    title: '渠道代码',
53
+    dataIndex: 'name',
54
+    key: 'name',
55
+    align: 'center',
56
+    render: text => <a>{text}</a>,
57
+  },
58
+  {
59
+    title: '渠道名称',
60
+    dataIndex: 'integral',
61
+    key: 'integral',
62
+    align: 'center',
63
+  },
64
+  {
65
+    title: '联系人',
66
+    dataIndex: 'total',
67
+    key: 'total',
68
+    align: 'center',
69
+  },
70
+  {
71
+    title: '联系电话',
72
+    dataIndex: 'exchanged',
73
+    key: 'exchanged',
74
+    align: 'center',
75
+  },
76
+  {
77
+    title: '经纪人',
78
+    dataIndex: 'rest',
79
+    key: 'rest',
80
+    align: 'center',
81
+  },
82
+  {
83
+    title: '推荐客户有效',
84
+    dataIndex: 'state',
85
+    key: 'state',
86
+    align: 'center',
87
+  },
88
+  {
89
+    title: '邀请经济人',
90
+    dataIndex: 'handle',
91
+    key: 'handle',
92
+    align: 'center',
93
+    render: () => <a>Delete</a>,
94
+  },
95
+];
96
+
97
+export default () => (
98
+  <>
99
+    <div className={channels.searchBox}>
100
+      <dvi>
101
+        <span className={channels.selectName}>渠道名称</span>
102
+        <Select defaultValue="lucy" style={{ width: 180 }} onChange={handleChange}>
103
+          <Option value="jack">Jack</Option>
104
+          <Option value="lucy">Lucy</Option>
105
+          <Option value="disabled" disabled>
106
+            Disabled
107
+          </Option>
108
+          <Option value="Yiminghe">yiminghe</Option>
109
+        </Select>
110
+      </dvi>
111
+      <Button className={channels.about}>查询</Button>
112
+    </div>
113
+    <Button className={channels.addBtn}>新增</Button>
114
+    <Table dataSource={dataSource} columns={columns} />
115
+  </>
116
+);
117
+
118
+function handleMenuClick(e) {
119
+  message.info('Click on menu item.');
120
+  console.log('click', e);
121
+}

+ 46
- 0
src/pages/channel/channelList.less Näytä tiedosto

@@ -0,0 +1,46 @@
1
+.searchBox {
2
+  font-size: 30px;
3
+  color: red;
4
+  display: flex;
5
+  display: flex;
6
+  align-items: center;
7
+  justify-content: space-between;
8
+  .searchItem {
9
+    min-width: 20px;
10
+    margin-right: 20px;
11
+    text-align: left;
12
+    .anticon-down {
13
+      float: right !important;
14
+    }
15
+  }
16
+}
17
+.addBtn {
18
+  padding: 0 30px;
19
+  height: 36px;
20
+  background-color: #50be00;
21
+  color: #fff;
22
+  margin: 30px 0;
23
+}
24
+.touxiang {
25
+  width: 93px;
26
+  height: 93px;
27
+}
28
+.ant-table-column-title {
29
+  font-weight: 600;
30
+}
31
+
32
+.about {
33
+  padding: 0 30px;
34
+  height: 36px;
35
+  background-color: #00bfff;
36
+  color: #fff;
37
+  margin: 30px 0;
38
+}
39
+
40
+.selectName {
41
+  font-size: 17px;
42
+  padding: 0 10px;
43
+  height: 36px;
44
+  color: rgb(10, 10, 10);
45
+  margin: 30px 0;
46
+}