许静 il y a 5 ans
Parent
révision
ceb94b3180

+ 36
- 0
config/config.js Voir le fichier

@@ -112,6 +112,30 @@ export default {
112 112
               name: '首页',
113 113
               component: './Welcome',
114 114
             },
115
+            {
116
+              path: '/building',
117
+              name: '项目管理',
118
+              component: '../layouts/BlankLayout',
119
+              routes: [
120
+                {
121
+                  path: '/building/list',
122
+                  name: '项目列表',
123
+                  component: './building/list/index',
124
+                },
125
+              ],
126
+            },
127
+            // {
128
+            //   path: '/welcome2',
129
+            //   name: '首页2',
130
+            //   component: '../layouts/BlankLayout',
131
+            //   routes:[
132
+            //     {
133
+            //       path: '/welcome3',
134
+            //       name: '首页3',
135
+            //       component: './Welcome',
136
+            //     },
137
+            //   ]
138
+            // },
115 139
             {
116 140
               path: '/integralMall',
117 141
               name: '积分商城',
@@ -124,6 +148,18 @@ export default {
124 148
                 },
125 149
               ],
126 150
             },
151
+            {
152
+              path: '/channel',
153
+              name: '渠道管理',
154
+              component: '../layouts/BlankLayout',
155
+              routes: [
156
+                {
157
+                  path: '/channel/channelList',
158
+                  name: '渠道管理',
159
+                  component: './channel/channelList',
160
+                },
161
+              ],
162
+            },
127 163
             {
128 164
               component: './404',
129 165
             },

+ 15
- 5
package.json Voir le fichier

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

+ 168
- 0
src/pages/building/list/index.jsx Voir le fichier

@@ -0,0 +1,168 @@
1
+import React from 'react';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination } from 'antd';
3
+import Styles from './style.less';
4
+
5
+const { Option } = Select;
6
+const { Meta } = Card;
7
+
8
+
9
+// 提交事件
10
+function handleSubmit(e, props) {
11
+  e.preventDefault();
12
+  props.form.validateFields((err, values) => {
13
+    if (!err) {
14
+      console.log('提交数据: ', values)
15
+    }
16
+  });
17
+}
18
+
19
+// Change 事件
20
+function handleSelectChange(props) {
21
+  console.log(props)
22
+}
23
+
24
+// 分页
25
+function onChange(pageNumber) {
26
+  console.log('Page: ', pageNumber);
27
+}
28
+
29
+/**
30
+ *
31
+ *
32
+ * @param {*} props
33
+ * @returns
34
+ */
35
+function header(props) {
36
+  const { getFieldDecorator } = props.form
37
+
38
+  return (
39
+    <>
40
+      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
41
+        <Form.Item>
42
+          {getFieldDecorator('code')(
43
+            <Input
44
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
45
+              placeholder="楼盘编号"
46
+            />,
47
+          )}
48
+        </Form.Item>
49
+        <Form.Item>
50
+          {getFieldDecorator('name')(
51
+            <Input
52
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
53
+              type="password"
54
+              placeholder="楼盘名称"
55
+            />,
56
+          )}
57
+        </Form.Item>
58
+        <Form.Item>
59
+          {getFieldDecorator('startDate')(
60
+            <DatePicker placeholder="开盘时间" />,
61
+          )}
62
+        </Form.Item>
63
+        <Form.Item>
64
+          {getFieldDecorator('buildingStatus')(
65
+            <Select style={{ width: '180px' }} placeholder="楼盘状态" onChange={handleSelectChange}>
66
+              <Option value="1">发布</Option>
67
+              <Option value="0">未发布</Option>
68
+            </Select>,
69
+          )}
70
+        </Form.Item>
71
+        <Form.Item>
72
+          {getFieldDecorator('marketStatus')(
73
+            <Select style={{ width: '180px' }} placeholder="销售状态" onChange={handleSelectChange}>
74
+              <Option value="1">已销售</Option>
75
+              <Option value="0">未销售</Option>
76
+            </Select>,
77
+          )}
78
+        </Form.Item>
79
+        <Form.Item>
80
+          {getFieldDecorator('cityId')(
81
+            <Select style={{ width: '180px' }} placeholder="城市" onChange={handleSelectChange}>
82
+              <Option value="male">male</Option>
83
+              <Option value="female">female</Option>
84
+            </Select>,
85
+          )}
86
+        </Form.Item>
87
+        <Form.Item>
88
+          {getFieldDecorator('isMain')(
89
+            <Select style={{ width: '180px' }} placeholder="首页推荐" onChange={handleSelectChange}>
90
+              <Option value="1">首页推荐</Option>
91
+              <Option value="0">首页未推荐</Option>
92
+            </Select>,
93
+          )}
94
+        </Form.Item>
95
+        <Form.Item>
96
+          <Button type="primary" htmlType="submit" className={Styles.SubmitButton}>
97
+            搜索
98
+          </Button>
99
+        </Form.Item>
100
+      </Form>
101
+      <Button type="primary" className={Styles.addButton}>
102
+        新增楼盘
103
+      </Button>
104
+
105
+      {/* 卡片内容,显示楼盘项目  */}
106
+      <Card
107
+        hoverable
108
+        style={{ width: '300px', height: '400px', borderRadius: '12px', boxShadow: '0px 0px 20px #e7e7e7e7' }}
109
+        cover={<img alt="example" src="https://os.alipayobjects.com/rmsportal/QBnOOoLaAfKPirc.png" style={{ width: '299px', height: '203px' }}></img>}
110
+        bodyStyle={{ padding: '10px' }}
111
+      >
112
+       <Row className={ Styles.cardText }>
113
+        <Col span={7}>楼盘编号:</Col>
114
+        <Col span={12}>S101</Col>
115
+        <Col span={5}>
116
+          <span className={ Styles.ediText }>编辑</span>
117
+          <Icon type="form" style={{ color: '#C0C4CC' }}/>
118
+        </Col>
119
+      </Row>
120
+      <Row>
121
+        <Col span={7}>楼盘名称:</Col>
122
+        <Col span={17}>城开花园</Col>
123
+      </Row>
124
+      <Row>
125
+        <Col span={7}>均&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;价:</Col>
126
+        <Col span={17}>
127
+          约<span style={{ color: '#FF0707', fontWeight: 'bold' }}>111</span>元/m
128
+        </Col>
129
+      </Row>
130
+      <Row>
131
+        <Col span={7}>项目地址:</Col>
132
+        <Col span={17}>顾戴路1801弄</Col>
133
+      </Row>
134
+      <Row>
135
+        <Col span={7}>发布状态:</Col>
136
+        <Col span={17}>已发布</Col>
137
+      </Row>
138
+      <Row>
139
+        <Col span={7}>录入时间:</Col>
140
+        <Col span={17}>2019-08-28 17</Col>
141
+      </Row>
142
+      <Row style={{ marginTop: '15px' }}>
143
+        <Col span={7}>
144
+          <span style={{ color: '#1990FF', fontWeight: 'bold' }}>
145
+            取消发布
146
+          </span>
147
+          <Icon type="close-circle" style={{ color: '#C0C4CC' }} />
148
+        </Col>
149
+        <Col span={12}></Col>
150
+        <Col span={5}>
151
+          <span style={{ color: '#FF4A4A', fontWeight: 'bold' }}>
152
+            删除
153
+          </span>
154
+          <Icon type="rest" style={{ color: '#C0C4CC' }} />
155
+        </Col>
156
+      </Row>
157
+      </Card>
158
+
159
+      {/* 分页 */}
160
+      <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
161
+        <Pagination showQuickJumper defaultCurrent={1} total={500} onChange={onChange} />
162
+      </div>
163
+    </>
164
+  );
165
+}
166
+const WrappedHeader = Form.create({ name: 'header' })(header);
167
+
168
+export default WrappedHeader

+ 31
- 0
src/pages/building/list/style.css Voir le fichier

@@ -0,0 +1,31 @@
1
+.SubmitButton {
2
+  background: #3a91d5;
3
+  border-radius: 7px;
4
+  border: 0px;
5
+}
6
+.SelectFrom {
7
+  width: 180px;
8
+  background: #ffffff;
9
+  border-radius: 7px;
10
+  border: 1px solid #dbdbdb;
11
+}
12
+.addButton {
13
+  background: #50be00;
14
+  border-radius: 4px;
15
+  border: 0px;
16
+  margin: 10px 0px;
17
+}
18
+.cardText {
19
+  font-size: 14px;
20
+  font-family: 'PingFangSC';
21
+  font-weight: 400;
22
+  color: #666666;
23
+  line-height: 25px;
24
+}
25
+.ediText {
26
+  font-size: 14px;
27
+  font-family: 'PingFangSC';
28
+  font-weight: 400;
29
+  color: #ff925c;
30
+  line-height: 25px;
31
+}

+ 37
- 0
src/pages/building/list/style.less Voir le fichier

@@ -0,0 +1,37 @@
1
+// @import '~antd/es/style/themes/default.less';
2
+
3
+.SubmitButton {
4
+  background: rgba(58, 145, 213, 1);
5
+  border-radius: 7px;
6
+  border: 0px;
7
+}
8
+
9
+.SelectFrom {
10
+  width: 180px;
11
+  background: rgba(255, 255, 255, 1);
12
+  border-radius: 7px;
13
+  border: 1px solid rgba(219, 219, 219, 1);
14
+}
15
+
16
+.addButton {
17
+  background:rgba(80,190,0,1);
18
+  border-radius:4px;
19
+  border: 0px;
20
+  margin: 10px 0px;
21
+}
22
+
23
+.cardText {
24
+  font-size:14px;
25
+  font-family:'PingFangSC';
26
+  font-weight:400;
27
+  color:rgba(102,102,102,1);
28
+  line-height:25px;
29
+}
30
+
31
+.ediText {
32
+  font-size:14px;
33
+  font-family:'PingFangSC';
34
+  font-weight:400;
35
+  color:rgba(255,146,92,1);
36
+  line-height:25px;
37
+}

+ 31
- 0
src/pages/building/list/style.wxss Voir le fichier

@@ -0,0 +1,31 @@
1
+.SubmitButton {
2
+  background: #3a91d5;
3
+  border-radius: 7px;
4
+  border: 0px;
5
+}
6
+.SelectFrom {
7
+  width: 180px;
8
+  background: #ffffff;
9
+  border-radius: 7px;
10
+  border: 1px solid #dbdbdb;
11
+}
12
+.addButton {
13
+  background: #50be00;
14
+  border-radius: 4px;
15
+  border: 0px;
16
+  margin: 10px 0px;
17
+}
18
+.cardText {
19
+  font-size: 14px;
20
+  font-family: 'PingFangSC';
21
+  font-weight: 400;
22
+  color: #666666;
23
+  line-height: 25px;
24
+}
25
+.ediText {
26
+  font-size: 14px;
27
+  font-family: 'PingFangSC';
28
+  font-weight: 400;
29
+  color: #ff925c;
30
+  line-height: 25px;
31
+}

+ 121
- 0
src/pages/channel/channelList.jsx Voir le fichier

@@ -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 Voir le fichier

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