瀏覽代碼

Merge branch 'master' of http://git.ycjcjy.com/zhiyuxing/estateagents-admin-manager

傅行帆 5 年之前
父節點
當前提交
64220f2045

+ 6
- 1
src/global.less 查看文件

@@ -55,7 +55,12 @@ ol {
55 55
   box-shadow: none;
56 56
   border: none;
57 57
 }
58
-
58
+.ant-input-affix-wrapper .ant-input-prefix{
59
+  left:7px;
60
+}
61
+.ant-input-affix-wrapper .ant-input:not(:first-child) {
62
+  padding-left: 40px;
63
+}
59 64
 .ant-pro-global-header-trigger{
60 65
   display: none;
61 66
 }

+ 47
- 45
src/pages/integralMall/exchangeRecords.jsx 查看文件

@@ -246,52 +246,54 @@ function record(props) {
246 246
 
247 247
     <>
248 248
       <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
249
-        <Form.Item>
250
-          {getFieldDecorator('name')(
251
-            <Input
252
-              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
253
-              placeholder="用户姓名"
254
-            />,
255
-          )}
256
-        </Form.Item>
257
-        <Form.Item>
258
-          {getFieldDecorator('phone')(
259
-            <Input
260
-              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
261
-              placeholder="手机号"
262
-            />,
263
-          )}
264
-        </Form.Item>
265
-        <Form.Item>
266
-          {getFieldDecorator('goodName')(
267
-            <Input
268
-              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
269
-              placeholder="商品名称"
270
-            />,
271
-          )}
272
-        </Form.Item>
273
-        <Form.Item>
274
-          {getFieldDecorator('type')(
275
-            <Select style={{ width: '200px' }} placeholder="用户类型" onChange={handleSelectChange}>
276
-              <Option value="2">置业顾问</Option>
277
-              <Option value="1">销售主管</Option>
278
-              <Option value="0">经纪人</Option>
279
-            </Select>,
280
-          )}
281
-        </Form.Item>
282
-        <Form.Item>
283
-          {getFieldDecorator('state')(
284
-            <Select style={{ width: '200px' }} placeholder="状态" onChange={handleSelectChange}>
285
-              <Option value="1">已领取</Option>
286
-              <Option value="0">未领取</Option>
287
-            </Select>,
288
-          )}
289
-        </Form.Item>
290
-        <Form.Item>
291
-          <Button type="primary" htmlType="submit" className={styles.searchBtn}>
292
-            搜索
249
+        <div style={{ display: 'flex' }}>
250
+          <Form.Item>
251
+            {getFieldDecorator('name')(
252
+              <Input
253
+                prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
254
+                placeholder="用户姓名"
255
+              />,
256
+            )}
257
+          </Form.Item>
258
+          <Form.Item>
259
+            {getFieldDecorator('phone')(
260
+              <Input
261
+                prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
262
+                placeholder="手机号"
263
+              />,
264
+            )}
265
+          </Form.Item>
266
+          <Form.Item>
267
+            {getFieldDecorator('goodName')(
268
+              <Input
269
+                prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
270
+                placeholder="商品名称"
271
+              />,
272
+            )}
273
+          </Form.Item>
274
+          <Form.Item>
275
+            {getFieldDecorator('type')(
276
+              <Select style={{ width: '220px' }} placeholder="用户类型" onChange={handleSelectChange}>
277
+                <Option value="2">置业顾问</Option>
278
+                <Option value="1">销售主管</Option>
279
+                <Option value="0">经纪人</Option>
280
+              </Select>,
281
+            )}
282
+          </Form.Item>
283
+          <Form.Item>
284
+            {getFieldDecorator('state')(
285
+              <Select style={{ width: '220px' }} placeholder="状态" onChange={handleSelectChange}>
286
+                <Option value="1">已领取</Option>
287
+                <Option value="0">未领取</Option>
288
+              </Select>,
289
+            )}
290
+          </Form.Item>
291
+          <Form.Item>
292
+            <Button type="primary" htmlType="submit" className={styles.searchBtn}>
293
+              搜索
293 294
           </Button>
294
-        </Form.Item>
295
+          </Form.Item>
296
+        </div>
295 297
         <Form.Item>
296 298
           <DateRange />
297 299
         </Form.Item>

+ 210
- 0
src/pages/news/list/NewsList.jsx 查看文件

@@ -0,0 +1,210 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert } from 'antd';
3
+import moment from 'moment';
4
+import request from '../../../utils/request';
5
+import apis from '../../../services/apis';
6
+import Styles from './style.less';
7
+
8
+
9
+const { Option } = Select;
10
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
11
+const { Meta } = Card;
12
+
13
+const tempDate = [{ code: 's101' }]
14
+
15
+/**
16
+ *卡片
17
+ *
18
+ * @returns
19
+ */
20
+function CartBody(props) {
21
+  const { data } = props
22
+  console.log(props);
23
+  return (
24
+          <Card
25
+            hoverable
26
+            style={{ minWidth: '400px', borderRadius: '12px', margin: '10px', boxShadow: '0px 0px 16px 2px rgba(0,0,0,0.12)' }}
27
+            cover={<img alt="example" src={ data.newsImg } style={{ borderRadius: '12px 12px 0 0', width: '100%', height: '14vw' }}></img>}
28
+            bodyStyle={{ padding: '10px 20px' }}
29
+          >
30
+            <p className={Styles.cardText}>
31
+              <span className={Styles.title}>资讯类型</span>
32
+              <span >:{ data.newsType.newsTypeName }</span>
33
+              <span className={Styles.ediText}>
34
+                编辑
35
+                <Icon type="form" style={{ color: '#C0C4CC', marginLeft: '10px' }} />
36
+              </span>
37
+            </p>
38
+            <p className={Styles.cardText}>
39
+              <span className={Styles.title}>状态</span>
40
+              <span >:{ data.status == '0' ? "已发布" : "未发布" }</span>
41
+            </p>
42
+            <p className={Styles.cardItem}>
43
+              <span className={Styles.title}>阅读数量</span>
44
+              <span > :{ data.pvNum }</span>
45
+            </p>
46
+            <p className={Styles.cardItem}>
47
+              <span className={Styles.title}>转发数量</span>
48
+              <span className={ Styles.address }>:{ data.shareNum }</span>
49
+            </p>
50
+            <p className={Styles.cardItem}>
51
+              <span className={Styles.title}>点赞数量</span>     
52
+              <span >:{ data.favorNum }</span>         
53
+            </p>
54
+            <p className={Styles.cardItem}>
55
+              <span className={Styles.title}>收藏数量</span>
56
+              <span >:{ data.saveNum }</span>
57
+            </p>
58
+            <p className={Styles.cardItem}>
59
+              <span className={Styles.title}>录入时间</span>
60
+              <span >:{ data.createDate }</span>
61
+            </p>
62
+            <p style={{ margin: '15px 0', position: 'relative', fontSize: '18px' }}>
63
+              <span style={{ color: '#1990FF' }}>
64
+                取消发布
65
+                <Icon type="close-circle" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
66
+              </span>
67
+              <span style={{
68
+                color: '#FF4A4A', position: 'absolute', right: '0',
69
+              }} >
70
+                删除
71
+                <Icon type="rest" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
72
+              </span>
73
+            </p>
74
+          </Card>
75
+  )
76
+}
77
+
78
+/**
79
+ *
80
+ *
81
+ * @param {*} props
82
+ * @returns
83
+ */
84
+function body(props) {
85
+  const { getFieldDecorator } = props.form
86
+
87
+  // eslint-disable-next-line react-hooks/rules-of-hooks
88
+  const [dataSource, setDataSource] = useState({ records: [] })
89
+
90
+  // eslint-disable-next-line react-hooks/rules-of-hooks
91
+  useEffect(() => {
92
+    getList({ pageNum: 1, pageSize: 6 })
93
+  }, [])
94
+
95
+  function getList(params) {
96
+    // 网路请求
97
+    request({ ...apis.news.getList, params: { ...params } }).then(res => {
98
+      setDataSource(res)
99
+    }).catch(err => {
100
+      // eslint-disable-next-line no-unused-expressions
101
+      <Alert
102
+        style={{
103
+          marginBottom: 24,
104
+        }}
105
+        message={err}
106
+        type="error"
107
+        showIcon
108
+      />
109
+    })
110
+  }
111
+
112
+  // 提交事件
113
+  function handleSubmit(e) {
114
+    e.preventDefault();
115
+    props.form.validateFields((err, values) => {
116
+      if (!err) {
117
+        // eslint-disable-next-line no-console
118
+        console.log('提交数据: ', values)
119
+        const { startDate } = values
120
+        getList({ pageNum: 1, pageSize: 9, ...values })
121
+      }
122
+    });
123
+  }
124
+
125
+  // Change 事件
126
+  function handleSelectChange(e) {
127
+    // eslint-disable-next-line no-console
128
+    console.log(e)
129
+  }
130
+
131
+  // 分页
132
+  function onChange(pageNumber) {
133
+    // eslint-disable-next-line react-hooks/rules-of-hooks
134
+      getList({ pageNum: pageNumber, pageSize: 9 })
135
+  }
136
+
137
+  function getDate(value, dateString) {
138
+    // moment(value).format('YYYY-MM-DD HH:mm:ss')
139
+    console.log(value, dateString)
140
+  }
141
+
142
+  return (
143
+    <>
144
+      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
145
+
146
+        <Form.Item>
147
+          {getFieldDecorator('city')(
148
+            <Select style={{ width: '180px' }} placeholder="请选择城市" onChange={handleSelectChange}>
149
+            </Select>,
150
+          )}
151
+        </Form.Item>
152
+
153
+        <Form.Item>
154
+          {getFieldDecorator('project')(
155
+            <Select style={{ width: '180px' }} placeholder="请选择项目" onChange={handleSelectChange}>
156
+            </Select>,
157
+          )}
158
+        </Form.Item>
159
+        <Form.Item>
160
+          {getFieldDecorator('title')(
161
+            <Input
162
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
163
+              placeholder="请输入标题"
164
+            />,
165
+          )}
166
+        </Form.Item>
167
+        <Form.Item>
168
+          {getFieldDecorator('type')(
169
+            <Select style={{ width: '180px' }} placeholder="咨询类型" onChange={handleSelectChange}>
170
+            </Select>,
171
+          )}
172
+        </Form.Item>       
173
+        <Form.Item>
174
+          {getFieldDecorator('newsStatus')(
175
+            <Select style={{ width: '180px' }} placeholder="状态" onChange={handleSelectChange}>
176
+              <Option value="1">已发布</Option>
177
+              <Option value="0">未发布</Option>
178
+            </Select>,
179
+          )}
180
+        </Form.Item>
181
+        <Form.Item>
182
+          <Button type="primary" htmlType="submit" className={Styles.SubmitButton}>
183
+            搜索
184
+          </Button>
185
+        </Form.Item>
186
+      </Form>
187
+      <Button type="primary" className={Styles.addButton}>
188
+        新增
189
+      </Button>
190
+
191
+      {/* 卡片内容,显示楼盘项目  */}
192
+      <Row style={{ padding: ' 0 10px' }}>
193
+        {
194
+          dataSource.records.map((item, index) => (
195
+              <Col span={8}>
196
+                <CartBody data={item} key={item.buildingId}/>
197
+              </Col>
198
+            ))
199
+        }
200
+      </Row>
201
+      {/* 分页 */}
202
+      <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
203
+        <Pagination showQuickJumper defaultCurrent={1} total={dataSource.total} onChange={onChange} />
204
+      </div>
205
+    </>
206
+  );
207
+}
208
+const WrappedBody = Form.create({ name: 'body' })(body);
209
+
210
+export default WrappedBody

+ 58
- 0
src/pages/news/list/style.less 查看文件

@@ -0,0 +1,58 @@
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: 18px;
20
+    color: #333;
21
+    line-height: 24px;
22
+    display: flex;
23
+    align-items: center;
24
+    position: relative;
25
+  
26
+  }
27
+  .cardItem{
28
+    font-size: 18px;
29
+    font-weight: 400;
30
+    color: #666;
31
+    line-height: 24px;
32
+    display: flex;
33
+    align-items: center;  
34
+  }
35
+  .ediText {
36
+    font-size: 18px;
37
+    color: #ff925c;
38
+    line-height: 24px;
39
+    position: absolute;
40
+    right: 0;
41
+  }
42
+  .title{
43
+    display: inline-block;
44
+    width: 84px;
45
+    justify-content: space-between;
46
+    text-align: justify;
47
+    text-align-last:justify
48
+  }
49
+  
50
+  .address { 
51
+    width: 400px;
52
+    height: 24px; 
53
+    text-overflow: ellipsis; 
54
+    white-space: nowrap;
55
+    overflow: hidden;
56
+  }
57
+  
58
+  

+ 1
- 1
src/pages/news/type/NewsType.jsx 查看文件

@@ -59,7 +59,7 @@ const columns = [
59 59
     title: '类型图片',
60 60
     dataIndex: 'img',
61 61
     key: 'img',
62
-    align: 'center',
62
+    align: 'left',
63 63
     render: (text, record) => <img src={record.img} className={styles.touxiang} />,
64 64
   },
65 65
   {

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

@@ -1,5 +1,5 @@
1 1
 .addBtn {
2
-  padding: 0 30px;
2
+  padding: 0 40px;
3 3
   height: 36px;
4 4
   background-color: #FF7E48;
5 5
   color: #fff;

+ 1
- 1
src/pages/user/login/components/Login/LoginSubmit.jsx 查看文件

@@ -9,7 +9,7 @@ const LoginSubmit = ({ className, ...rest }) => {
9 9
   const clsString = classNames(styles.submit, className);
10 10
   return (
11 11
     <FormItem>
12
-      <Button size="large" className={clsString} type="primary" htmlType="submit" {...rest} style={{ backgroundColor: '#DB3C4B', borderRadius: '4px', border: 'none' }} />
12
+      <Button size="large" className={clsString} type="primary" htmlType="submit" {...rest} style={{ backgroundColor: '#EF273A', borderRadius: '4px', border: 'none' }} />
13 13
     </FormItem>
14 14
   );
15 15
 };

+ 4
- 2
src/pages/user/login/components/Login/index.less 查看文件

@@ -82,8 +82,10 @@ position: relative;
82 82
   }
83 83
 
84 84
   .prefixIcon {
85
-    color: @disabled-color;
86
-    font-size: @font-size-base;
85
+    color: #fff;
86
+    font-size: 18px;
87
+    background-color: #EF273A;
88
+    padding: 3px 4px;
87 89
   }
88 90
 
89 91
   .submit {

+ 6
- 0
src/services/apis.js 查看文件

@@ -45,6 +45,12 @@ export default {
45 45
       url: `${prefix}/tdBuildingType/id`,
46 46
     },
47 47
   },
48
+  news: {
49
+    getList: {
50
+      method: 'GET',
51
+      url: `${prefix}/taNews`,
52
+    },
53
+  },
48 54
   customer: {
49 55
     drift: {
50 56
       method: 'GET',

+ 12
- 0
src/services/news.js 查看文件

@@ -0,0 +1,12 @@
1
+import request from '@/utils/request';
2
+
3
+/**
4
+ * 项目
5
+ */
6
+
7
+/**
8
+ * 获取列表
9
+ */
10
+export async function getList() {
11
+  return request('/api/admin/taNews')
12
+}