傅行帆 vor 5 Jahren
Ursprung
Commit
31b045c4a0

+ 24
- 0
config/routes.js Datei anzeigen

@@ -521,6 +521,30 @@ export default [
521 521
               },
522 522
             ],
523 523
           },
524
+          {
525
+            path: '/house',
526
+            name: '在线选房',
527
+            component: '../layouts/BlankLayout',
528
+            routes: [
529
+              {
530
+                path: '/house/list',
531
+                name: '房源管理',
532
+                component: './house/list/index',
533
+              },
534
+              {
535
+                path: '/house/add',
536
+                name: '新增', 
537
+                hideInMenu: true,
538
+                component: './house/add/index',
539
+              },
540
+              {
541
+                path: '/house/edit',
542
+                name: '编辑', 
543
+                hideInMenu: true,
544
+                component: './house/edit/index',
545
+              },
546
+            ],
547
+          },
524 548
           // {
525 549
           //   path: '/miniapp',
526 550
           //   name: '小程序管理',

+ 29
- 0
src/pages/house/add/index.jsx Datei anzeigen

@@ -0,0 +1,29 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, DatePicker } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import router from 'umi/router';
5
+import moment from 'moment';
6
+import styles from '../../style/GoodsList.less';
7
+import SelectCity from '../../../components/SelectButton/CitySelect'
8
+import BuildSelect from '../../../components/SelectButton/BuildSelect'
9
+import apis from '../../../services/apis';
10
+import request from '../../../utils/request';
11
+import AuthButton from '@/components/AuthButton';
12
+
13
+const { Option } = Select;
14
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
15
+
16
+const header = props => {
17
+   
18
+
19
+  const { getFieldDecorator } = props.form
20
+  return (
21
+
22
+    <>
23
+      <span>新增业</span>
24
+    </>
25
+  )
26
+}
27
+const WrappedHeader = Form.create({ name: 'header' })(header);
28
+
29
+export default WrappedHeader

+ 15
- 0
src/pages/house/edit/components/base.jsx Datei anzeigen

@@ -0,0 +1,15 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker, message, Upload } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import moment from 'moment';
5
+import router from 'umi/router';
6
+import apis from '../../../../services/apis';
7
+
8
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
9
+const { TextArea } = Input;
10
+
11
+const Base = props => {
12
+  return <div><span>销售批次信息</span></div>
13
+}
14
+
15
+export default Base

+ 15
- 0
src/pages/house/edit/components/house.jsx Datei anzeigen

@@ -0,0 +1,15 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker, message, Upload } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import moment from 'moment';
5
+import router from 'umi/router';
6
+import apis from '../../../../services/apis';
7
+
8
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
9
+const { TextArea } = Input;
10
+
11
+const House = props => {
12
+  return <div><span>房源信息</span></div>
13
+}
14
+
15
+export default House

+ 164
- 0
src/pages/house/edit/components/poster.jsx Datei anzeigen

@@ -0,0 +1,164 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker, message, Upload } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import moment from 'moment';
5
+import router from 'umi/router';
6
+import BuildSelect from '../../../../components/SelectButton/BuildSelect'
7
+import XForm, { FieldTypes } from '../../../../components/XForm';
8
+import Wangedit from '../../../../components/Wangedit/Wangedit'
9
+import request from '../../../../utils/request'
10
+import yinhao from '../../../../assets/yinhao.png'
11
+import xiaochengxu from '../../../../assets/xiaochengxu.png'
12
+import ImageUploader from '../../../../components/XForm/ImageUpload';
13
+import poster1 from '../../../../assets/poster1.png';
14
+import poster2 from '../../../../assets/poster2.png';
15
+import Styles from './style.less';
16
+import apis from '../../../../services/apis';
17
+
18
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
19
+const { TextArea } = Input;
20
+
21
+const Poster = props => {
22
+  const [inputValue, changeInput] = useState('')
23
+  const [textAreaValue, changeTextArea] = useState('')
24
+  const [imgValue, changeImg] = useState('')
25
+  const [posterId, setPosterId] = useState('')
26
+
27
+  const [building, setBuilding] = useState({ buildingImg: [{ url: '' }] })
28
+  const { buildingId } = props.building
29
+   // ============这边改造下就可以饿============================
30
+  if (buildingId) {
31
+    // eslint-disable-next-line react-hooks/rules-of-hooks
32
+    useEffect(() => {
33
+      request({
34
+        ...apis.activity.poster,
35
+        params: { targetId: buildingId, targetType: 'building' },
36
+      }).then(data => {
37
+        console.log(data, '2222')
38
+        if (data.length > 0) {
39
+          setPosterId(data[0].posterId)
40
+          changeImg(data[0].posterImg)
41
+          changeTextArea(data[0].posterDescription)
42
+          changeInput(data[0].posterTitle)
43
+        }
44
+      }).catch(err => {
45
+        message.info(err.msg || err.message)
46
+      })
47
+
48
+      getById(buildingId)
49
+      getMiniappName()
50
+    }, [])
51
+  }
52
+
53
+  // 获取详情信息
54
+  function getById(currentId) {
55
+
56
+    request({ ...apis.building.buildingGetById, urlData: { id: currentId } }).then(res => {
57
+      setBuilding(res)
58
+      console.log('getById: ', res)
59
+    })
60
+  }
61
+  // 获取小程序名称
62
+  const [miniappName, setMiniappName] = useState('')
63
+  function getMiniappName() {
64
+
65
+    request({ ...apis.building.getMiniappName }).then(res => {
66
+    
67
+      setMiniappName(res)
68
+     
69
+    })
70
+  }
71
+
72
+  const submitPoster = () => {
73
+    if (buildingId) {
74
+      if (!imgValue) {
75
+        message.error('请选择海报图片')
76
+        return
77
+      }
78
+
79
+      if (posterId) {
80
+        request({
81
+          ...apis.activity.updatePoster,
82
+          urlData: { id: posterId },
83
+          data: { targetId: buildingId, targetType: 'building', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue },
84
+        }).then(() => {
85
+          message.info('保存成功')
86
+        }).catch(err => {
87
+          message.info(err.msg || err.message)
88
+        })
89
+      } else {
90
+        request({
91
+          ...apis.activity.addPoster,
92
+          data: { targetId: buildingId, targetType: 'building', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue },
93
+        }).then(data => {
94
+          setPosterId(data.posterId)
95
+          message.info('保存成功')
96
+        }).catch(err => {
97
+          message.info(err.msg || err.message)
98
+        })
99
+      }
100
+    } else {
101
+      message.warn('请先保存基本信息数据')
102
+    }
103
+  }
104
+
105
+  return <div>
106
+    <div style={{ display: 'flex' }}>
107
+      <div style={{ width: '420px', height: '900px', display: 'inline-block', marginTop: '30px' }}>
108
+        <div style={{ width: '375px', height: '700px', backgroundColor: '#fff', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
109
+          <img style={{ width: '100%', height: '300px' }} src={imgValue ? imgValue : poster1} alt="" />
110
+
111
+          <p className={Styles.tagLabel}>
112
+            {
113
+              building.buildingTag && building.buildingTag.map(item => <span>{item.tagName}</span>)
114
+            }
115
+          </p>
116
+          <p style={{
117
+            margin: '10px 20px', fontSize: '20px', color: '#222', fontWeight: '600',
118
+            display: '-webkit-box', lineClamp: '3', height: '36px', lineHeight: '36px',
119
+            WebkitLineClamp: '1',
120
+            WebkitBoxOrient: 'vertical',
121
+            overflow: 'hidden',
122
+            textOverflow: 'ellipsis',
123
+          }}>{inputValue || (building.buildingName || '海报标题')}</p>
124
+          <p style={{ color: '#999', padding: ' 0 20px' }}><span style={{ color: '#fd0d0c', fontSize: '24px', marginLeft: '6px' }}>{building.price} </span><span style={{ color: '#fd0d0c', fontSize: '20px' }}></span></p>
125
+          <img src={yinhao} style={{ width: '30px', marginLeft: '22px' }} alt="" />
126
+          <p style={{
127
+            margin: '16px 20px 28px 20px', fontSize: '17px', color: '#999',
128
+            display: '-webkit-box', lineClamp: '3', height: '72px',
129
+            WebkitLineClamp: '3',
130
+            WebkitBoxOrient: 'vertical',
131
+            overflow: 'hidden',
132
+            textOverflow: 'ellipsis',
133
+          }}>{textAreaValue || '海报描述'}</p>
134
+          <div style={{ backgroundColor: '#f1f1f1', padding: '22px 30px', boxShadow: '0px 6px 12px -4px #dcdcdc',position:'relative' }}>
135
+            <p style={{margin:'0',fontSize:'18px',color:'#888'}}>长按识别小程序码</p>
136
+            <p style={{margin:'0',fontSize:'18px',color:'#888'}}>进入<span style={{margin:'0 5px',fontSize:'18px',color:'#333',fontWeight:'600'}}>{miniappName||'置业V顾问'}</span>报名活动</p>
137
+            <img style={{ width: '80px',position: 'absolute',right:'30px',top:'10px' }} src={xiaochengxu} alt="" />
138
+          </div>
139
+        </div>
140
+        <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
141
+      </div>
142
+      <div >
143
+        <div style={{ display: 'flex', width: '100%', margin: '30px 0' }}>
144
+          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}><span style={{ color: 'red' }}>*</span> 楼盘海报图</p>
145
+          <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
146
+        </div>
147
+        <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于楼盘海报</p>
148
+        <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
149
+          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
150
+          <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
151
+        </div>
152
+        <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
153
+          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报描述</p>
154
+          <TextArea rows={5} maxLength={1024} value={textAreaValue} onChange={e => changeTextArea(e.target.value)} />
155
+        </div>
156
+
157
+      </div>
158
+    </div>
159
+    <Button type="primary" onClick={submitPoster} style={{ margin: '40px 40px 40px 30vw' }}> 确定</Button>
160
+    <Button onClick={() => router.go(-1)}>取消</Button>
161
+  </div>
162
+}
163
+
164
+export default Poster

+ 15
- 0
src/pages/house/edit/components/preselectionImg.jsx Datei anzeigen

@@ -0,0 +1,15 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker, message, Upload } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import moment from 'moment';
5
+import router from 'umi/router';
6
+import apis from '../../../../services/apis';
7
+
8
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
9
+const { TextArea } = Input;
10
+
11
+const PreselectionImg = props => {
12
+  return <div><span>预选热度图</span></div>
13
+}
14
+
15
+export default PreselectionImg

+ 15
- 0
src/pages/house/edit/components/preselectionRecord.jsx Datei anzeigen

@@ -0,0 +1,15 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker, message, Upload } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import moment from 'moment';
5
+import router from 'umi/router';
6
+import apis from '../../../../services/apis';
7
+
8
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
9
+const { TextArea } = Input;
10
+
11
+const PreselectionRecord = props => {
12
+  return <div><span>预选记录</span></div>
13
+}
14
+
15
+export default PreselectionRecord

+ 96
- 0
src/pages/house/edit/components/share.jsx Datei anzeigen

@@ -0,0 +1,96 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker, message, Upload } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import moment from 'moment';
5
+import router from 'umi/router';
6
+import BuildSelect from '../../../../components/SelectButton/BuildSelect'
7
+import XForm, { FieldTypes } from '../../../../components/XForm';
8
+import Wangedit from '../../../../components/Wangedit/Wangedit'
9
+import request from '../../../../utils/request'
10
+import yinhao from '../../../../assets/yinhao.png'
11
+import ImageUploader from '../../../../components/XForm/ImageUpload';
12
+import logo from '../../../../assets/logo.png';
13
+import touxiang from '../../../../assets/touxiang.jpg';
14
+import poster1 from '../../../../assets/poster1.png';
15
+import poster2 from '../../../../assets/poster2.png';
16
+import apis from '../../../../services/apis';
17
+
18
+const Share = props => {
19
+  const [inputValue, changeInput] = useState('')
20
+  const [imgValue, changeImg] = useState('')
21
+  const [shareContentId, setShareContentId] = useState('')
22
+// ============这边改造下就可以饿============================
23
+  const { buildingId } = props.building
24
+  if (buildingId) {
25
+    // eslint-disable-next-line react-hooks/rules-of-hooks
26
+    useEffect(() => {
27
+      request({
28
+        ...apis.activity.shareContent,
29
+        params: { targetId: buildingId, targetType: 'building' },
30
+      }).then(data => {
31
+        if (data.length > 0) {
32
+          setShareContentId(data[0].shareContentId)
33
+          changeImg(data[0].shareContentImg)
34
+          changeInput(data[0].shareContentTitle)
35
+        }
36
+      }).catch(err => {
37
+        message.info(err.msg || err.message)
38
+      })
39
+    }, [])
40
+  }
41
+
42
+  const submitShare = () => {
43
+    if (buildingId) {
44
+      if (shareContentId) {
45
+        request({
46
+          ...apis.activity.updateShareContent,
47
+          urlData: { id: shareContentId },
48
+          data: { targetId: buildingId, shareContentType: 'building', shareContentImg: imgValue,shareContentTitle: inputValue },
49
+        }).then(data => {
50
+          message.info('保存成功')
51
+        }).catch(err => {
52
+          message.info(err.msg || err.message)
53
+        })
54
+       } else {
55
+        request({
56
+          ...apis.activity.addShareContent,
57
+          data: { targetId: buildingId, shareContentType: 'building', shareContentImg: imgValue,shareContentTitle: inputValue },
58
+        }).then(data => {
59
+          setShareContentId(data.shareContentId)
60
+          message.info('保存成功')
61
+        }).catch(err => {
62
+          message.info(err.msg || err.message)
63
+        })
64
+       }
65
+     } else {
66
+      message.warn('请先保存基本信息数据')
67
+     }
68
+  }
69
+
70
+  return <div style={{ padding: '20px' }}>
71
+    <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
72
+      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享模板</p>
73
+      <div>
74
+        <p style={{ display: 'flex', alignItems: 'center', fontSize: '14px', color: '#999', margin: '0', lineHeight: '0' }}>
75
+          <img src={logo} style={{ width: '22px', marginRight: '10px' }} />
76
+          知与行互动
77
+        </p>
78
+        <p style={{ fontSize: '16px', color: '#222', fontWeight: '600', margin: '0' }}>{inputValue ? inputValue : '置业V客厅 精准获客平台'}</p>
79
+        <img style={{ width: '200px', height: '160px' }} src={imgValue ? imgValue : poster2} alt="" />
80
+      </div>
81
+    </div>
82
+    <div style={{ display: 'flex', alignItems: 'center', width: '100%' }}>
83
+      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享标题</p>
84
+      <Input placeholder="请输入分享标题" value={inputValue} onChange={e => changeInput(e.target.value)} />
85
+    </div>
86
+    <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
87
+      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>楼盘分享图</p>
88
+      <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
89
+    </div>
90
+    <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginTop: '20px' }}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于楼盘分享好友</p>
91
+    <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
92
+    <Button onClick={() => router.go(-1)}>取消</Button>
93
+  </div>
94
+}
95
+
96
+export default Share

+ 15
- 0
src/pages/house/edit/components/shareRecord.jsx Datei anzeigen

@@ -0,0 +1,15 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker, message, Upload } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import moment from 'moment';
5
+import router from 'umi/router';
6
+import apis from '../../../../services/apis';
7
+
8
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
9
+const { TextArea } = Input;
10
+
11
+const ShareRecord = props => {
12
+  return <div><span>分享记录</span></div>
13
+}
14
+
15
+export default ShareRecord

+ 97
- 0
src/pages/house/edit/components/style.less Datei anzeigen

@@ -0,0 +1,97 @@
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
+  border-radius: 4px;
14
+  border: 0px;
15
+  margin: 10px 0px;
16
+}
17
+.cardText {
18
+  font-size: 0.106rem;
19
+  color: #333;
20
+  display: flex;
21
+  align-items: center;
22
+  position: relative;
23
+  margin-bottom: 0.08rem; 
24
+}
25
+
26
+.recommderTag{
27
+  position: absolute;
28
+  color: #fff;
29
+  line-height: 0.28rem;
30
+  width: 0.54rem;
31
+  background-color: rgba(0,0,0,0.4);
32
+  text-align: center;
33
+  border-radius: 12px 0 12px 0;
34
+  font-size: 0.09rem;
35
+}
36
+.cardItem{
37
+  font-size: 0.106rem;
38
+  font-weight: 400;
39
+  color: #666;
40
+  display: flex;
41
+  align-items: center;  
42
+  margin-bottom: 0.08rem;
43
+  .title{
44
+    display: inline-block;
45
+    width: 0.58rem;
46
+  
47
+    min-width: 0.58rem;
48
+    justify-content: space-between;
49
+    text-align: justify;
50
+    text-align-last:justify
51
+  }
52
+  
53
+}
54
+.cardText{
55
+  font-size: 0.106rem;
56
+  font-weight: 400;
57
+  color: #666;
58
+  display: flex;
59
+  align-items: center;  
60
+  margin-bottom: 0.08rem;
61
+  .title{
62
+    display: inline-block;
63
+    width: 0.58rem;
64
+  
65
+    min-width: 0.58rem;
66
+    justify-content: space-between;
67
+    text-align: justify;
68
+    text-align-last:justify
69
+  }
70
+  
71
+}
72
+.ediText {
73
+  font-size: 0.106rem;
74
+  color: #ff925c;
75
+  position: absolute;
76
+  right: 0;
77
+
78
+}
79
+
80
+
81
+.address { 
82
+  width: 400px;
83
+  height: 24px; 
84
+  text-overflow: ellipsis; 
85
+  white-space: nowrap;
86
+  overflow: hidden;
87
+}
88
+.cover{
89
+  width: 100%;
90
+
91
+  padding-bottom: 56.25%;
92
+  background-size: 100% 100% !important;
93
+ 
94
+  border-radius: 12px 12px 0 0;
95
+  
96
+    // height: '14vw';
97
+}

+ 15
- 0
src/pages/house/edit/components/visitRecord.jsx Datei anzeigen

@@ -0,0 +1,15 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker, message, Upload } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import moment from 'moment';
5
+import router from 'umi/router';
6
+import apis from '../../../../services/apis';
7
+
8
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
9
+const { TextArea } = Input;
10
+
11
+const VisitRecord = props => {
12
+  return <div><span>访问记录</span></div>
13
+}
14
+
15
+export default VisitRecord

+ 76
- 0
src/pages/house/edit/index.jsx Datei anzeigen

@@ -0,0 +1,76 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Radio, Tag, Tooltip, Tabs, notification } from 'antd';
3
+import moment from 'moment';
4
+import request from '../../../utils/request';
5
+import apis from '../../../services/apis';
6
+import { router } from 'umi';
7
+
8
+import Base from './components/base'
9
+import House from './components/house'
10
+import Poster from './components/poster'
11
+import Share from './components/share'
12
+import PreselectionImg from './components/preselectionImg'
13
+import PreselectionRecord from './components/preselectionRecord'
14
+import ShareRecord from './components/shareRecord'
15
+import VisitRecord from './components/visitRecord'
16
+
17
+
18
+const { Option } = Select
19
+const { TabPane } = Tabs;
20
+
21
+const formItemLayout = {
22
+  labelCol: {
23
+    xs: { span: 24 },
24
+    sm: { span: 2 },
25
+  },
26
+  wrapperCol: {
27
+    xs: { span: 24 },
28
+    sm: { span: 16 },
29
+  },
30
+};
31
+
32
+function openNotificationWithIcon(type, message) {
33
+  notification[type]({
34
+    message,
35
+    description:
36
+      '',
37
+  });
38
+}
39
+
40
+function EditHouse(props) {
41
+
42
+  const [tab, setTab] = useState('base')
43
+  
44
+  function tabsCallback(e) {
45
+    setTab(e.target.value)
46
+  }
47
+
48
+  return (
49
+    <>
50
+      <Radio.Group value={ tab } buttonStyle="solid" onChange={e => tabsCallback(e)}>
51
+        <Radio.Button value="base">销售批次信息</Radio.Button>
52
+        <Radio.Button value="house">房源信息</Radio.Button>
53
+        <Radio.Button value="poster">海报设置</Radio.Button>
54
+        <Radio.Button value="share">分享设置</Radio.Button>
55
+        <Radio.Button value="preselectionImg">预选热度图</Radio.Button>
56
+        <Radio.Button value="preselectionRecord">预选记录</Radio.Button>
57
+        <Radio.Button value="shareRecord">分享记录</Radio.Button>
58
+        <Radio.Button value="visitRecord">访问记录</Radio.Button>
59
+      </Radio.Group>
60
+      <div style={{ marginTop: '20px' }}>
61
+        { (tab === 'base' && <Base />)} 
62
+        { (tab === 'house' && <House />)}
63
+        { (tab === 'poster' && <Poster />)}
64
+        { (tab === 'share' && <Share />)}
65
+        { (tab === 'preselectionImg' && <PreselectionImg />)}
66
+        { (tab === 'preselectionRecord' && <PreselectionRecord />)}
67
+        { (tab === 'shareRecord' && <ShareRecord />)}
68
+        { (tab === 'visitRecord' && <VisitRecord />)}
69
+      </div>
70
+    </>
71
+  )
72
+}
73
+
74
+const WrappedEditHouseForm = Form.create({ name: 'editHouse' })(EditHouse);
75
+
76
+export default WrappedEditHouseForm

+ 348
- 0
src/pages/house/list/index.jsx Datei anzeigen

@@ -0,0 +1,348 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, DatePicker } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import router from 'umi/router';
5
+import moment from 'moment';
6
+import styles from '../../style/GoodsList.less';
7
+import SelectCity from '../../../components/SelectButton/CitySelect'
8
+import BuildSelect from '../../../components/SelectButton/BuildSelect'
9
+import apis from '../../../services/apis';
10
+import request from '../../../utils/request';
11
+import AuthButton from '@/components/AuthButton';
12
+
13
+const { Option } = Select;
14
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
15
+
16
+const header = props => {
17
+  // eslint-disable-next-line react-hooks/rules-of-hooks
18
+  const [data, setData] = useState({ list: [], total: 0 })
19
+  //   const [page, changePage] = useState({})
20
+  const [time, setTime] = useState('')
21
+
22
+  //==========看这里-- 新功能都用house为中间单词,我已经创建好了,你只要修改list的指向链接就行,看完删除=========
23
+  // 查询列表
24
+  const getList = params => {
25
+    request({ ...apis.house.list, params: { ...params } }).then(data => {
26
+      console.log(data)
27
+      setData(data)
28
+    })
29
+  }
30
+
31
+  // eslint-disable-next-line react-hooks/rules-of-hooks
32
+  useEffect(() => {
33
+    getList({ pageNum: 1, pageSize: 10 });
34
+  }, [])
35
+
36
+  // 跳转到编辑商品
37
+  const toAddHouse = id => () => {
38
+    if(id) {
39
+      router.push({
40
+        pathname: '/house/edit',
41
+      });
42
+      return
43
+    }
44
+    router.push({
45
+      pathname: '/house/add',
46
+    });
47
+  }
48
+
49
+  const newQrcode = row => {
50
+    const x = new XMLHttpRequest();
51
+    const resourceUrl = row.qrCode
52
+    x.open('GET', resourceUrl, true);
53
+    x.responseType = 'blob';
54
+    x.onload = function (e) {
55
+      const url = window.URL.createObjectURL(x.response)
56
+      const a = document.createElement('a');
57
+      a.href = url;
58
+      a.style.display = 'none'
59
+      a.download = '活动二维码.png';
60
+      a.click();
61
+    }
62
+    x.send();
63
+  }
64
+
65
+  const getActivityDetail = (dynamicId) => () => {
66
+    router.push({
67
+      pathname: '/activity/detailActivity',
68
+      query: {
69
+        dynamicId,
70
+      },
71
+    });
72
+  }
73
+
74
+  const getJoinPeople = (dynamicId) => () => {
75
+    router.push({
76
+      pathname: '/activity/SignList',
77
+      query: {
78
+        dynamicId,
79
+      },
80
+    });
81
+  }
82
+  /**
83
+   *
84
+   *
85
+   * @param {*} props
86
+   * @returns
87
+   */
88
+  const columns = [
89
+    {
90
+      title: '活动标题',
91
+      dataIndex: 'title',
92
+      key: 'title',
93
+      align: 'center',
94
+      // width: '15%',
95
+      render:  (x, row) => <><div style={{overflow: 'hidden',textOverflow: 'ellipsis',whiteSpace: 'nowrap', width: '201px',title:'content'}}>
96
+                              <span style={{color: 'blue',cursor: 'pointer'}} onClick={toAddHouse(1)}>{row.title}</span></div></>,
97
+      // width: '300px',
98
+      // ellipsis:'true'overflow: hidden; /*溢出隐藏*/
99
+// text-overflow: ellipsis; /*以省略号...显示*/
100
+// white-space: nowrap;
101
+    },
102
+    {
103
+      title: '活动时间',
104
+      dataIndex: 'startDate',
105
+      key: 'startDate',
106
+      align: 'center',
107
+      // width: '15%',
108
+      // width: '20%',
109
+      render: (x, row) => <><span>{`${moment(row.startDate).format('YYYY-MM-DD')} —— ${moment(row.endDate).format('YYYY-MM-DD')}`}</span></>,
110
+    },
111
+    {
112
+      title: '已参加人数',
113
+      dataIndex: 'count',
114
+      key: 'count',
115
+      align: 'center',
116
+      render:  (x, row) => <><div style={{overflow: 'hidden',textOverflow: 'ellipsis',whiteSpace: 'nowrap', width: '201px',title:'content'}}>
117
+                              <span style={{color: 'blue',cursor: 'pointer'}} onClick={getJoinPeople(row.dynamicId)}>{row.count}</span></div></>,
118
+      // width: '10%',
119
+      // width: '6%',
120
+    },
121
+    // {
122
+    //   title: '阅读量',
123
+    //   dataIndex: 'pvNum',
124
+    //   key: 'pvNum',
125
+    //   align: 'center',
126
+    //   // width: '10%',
127
+    // },
128
+    // {
129
+    //   title: '转发量',
130
+    //   dataIndex: 'shareNum',
131
+    //   key: 'shareNum',
132
+    //   align: 'center',
133
+    //   // width: '10%',
134
+    // },
135
+    // {
136
+    //   title: '收藏数',
137
+    //   dataIndex: 'saveNum',
138
+    //   key: 'saveNum',
139
+    //   align: 'center',
140
+    //   // width: '10%',
141
+    // },
142
+    {
143
+      title: '报名状态',
144
+      dataIndex: 'activityStatus',
145
+      key: 'activityStatus',
146
+      align: 'center',
147
+      // width: '10%',
148
+      render: activityStatus => <><span>{activityStatus == 0 ? '进行中' : activityStatus == 1 ? '未开始' : '已结束'}</span></>,
149
+    },
150
+    {
151
+      title: '权重',
152
+      dataIndex: 'heavy',
153
+      key: 'heavy',
154
+      align: 'center',
155
+    },
156
+  ];
157
+  const getSignList = dynamicId => {
158
+    router.push({
159
+      pathname: '/activity/SignList',
160
+      query: {
161
+        dynamicId,
162
+      },
163
+    });
164
+  }
165
+
166
+  const finishDynamic = row => {
167
+    Modal.confirm({
168
+      title: '活动会被强制结束,小程序端无法再发起或参与此活动,如果不想让客户看到活动,请再点击取消发布按钮',
169
+      okText: '确定',
170
+      cancelText: '取消',
171
+      onOk () {
172
+        request({ ...apis.activity.finish, data: { dynamicId: row.dynamicId, top: '' } }).then(data => {
173
+          console.log(data)
174
+          message.info('操作成功!')
175
+          getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() })
176
+        }).catch(err => {
177
+          console.log(err)
178
+          message.info(err.msg || err.message)
179
+        })
180
+      },
181
+    });
182
+  }
183
+
184
+  //   置顶
185
+  const topDynamic = row => () => {
186
+    const weight = Math.abs(row.weight - 1)
187
+    request({ ...apis.activity.weight, params: { dynamicId: row.dynamicId, weight } }).then(data => {
188
+      console.log(data)
189
+      message.info('操作成功!')
190
+      getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() })
191
+    }).catch(err => {
192
+      console.log(err)
193
+      message.info(err.msg || err.message)
194
+    })
195
+  }
196
+
197
+  //   推首页
198
+  const homeDynamic = row => () => {
199
+    const home = Math.abs(row.home - 1)
200
+    request({ ...apis.activity.home, params: { dynamicId: row.dynamicId, home } }).then(data => {
201
+      console.log(data)
202
+      message.info('操作成功!')
203
+      getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() })
204
+    }).catch(err => {
205
+      console.log(err)
206
+      message.info(err.msg || err.message)
207
+    })
208
+  }
209
+
210
+  const sendOrPublicDynamic = row => {
211
+    if (row.status === 1) {
212
+      cancelDynamic(row)
213
+    } else {
214
+      sendDynamic(row)
215
+    }
216
+  }
217
+
218
+  // 取消活动
219
+  const cancelDynamic = row => {
220
+    Modal.confirm({
221
+      title: '活动会在小程序端隐藏,后台可以继续编辑重新发布',
222
+      okText: '确认',
223
+      cancelText: '取消',
224
+      onOk() {
225
+        request({ ...apis.activity.cancel, urlData: { id: row.dynamicId } }).then(data => {
226
+          message.info('操作成功!')
227
+          getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue()  })
228
+        }).catch(err => {
229
+          console.log(err)
230
+          message.info(err.msg || err.message)
231
+        })
232
+      }
233
+    });
234
+  }
235
+
236
+  // 发布活动
237
+  const sendDynamic = row => {
238
+    Modal.confirm({
239
+      title: '确定发布吗?',
240
+      okText: '确认',
241
+      cancelText: '取消',
242
+      onOk() {
243
+        request({ ...apis.activity.send, urlData: { id: row.dynamicId } }).then(data => {
244
+          message.info('操作成功!')
245
+          getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() });
246
+        }).catch(err => {
247
+          console.log(err)
248
+          message.info(err.msg || err.message)
249
+        })
250
+      }
251
+    });
252
+  }
253
+
254
+  const changePageNum = pageNumber => {
255
+    getList({ pageNum: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
256
+  }
257
+
258
+  // 提交事件
259
+  const handleSubmit = e => {
260
+    e.preventDefault();
261
+    props.form.validateFields((err, values) => {
262
+      if (!err) {
263
+        console.log('提交数据: ', values)
264
+        if (time) {
265
+          values.time = `${moment(time).format('YYYY-MM-DDT00:00:00.000')}Z`
266
+        } else {
267
+          values.time = null
268
+        }
269
+        
270
+        getList({ pageNum: 1, pageSize: 10, ...values })
271
+      }
272
+    });
273
+  }
274
+
275
+  // 重置搜索
276
+  function handleReset () {
277
+    props.form.resetFields();
278
+    setTime('')
279
+    getList({ pageNum: 1, pageSize: 10 })
280
+  }
281
+
282
+  // 时间回调
283
+  function timeOnChange(date, dateString) {
284
+    console.log(date, dateString)
285
+    setTime(date)
286
+  }
287
+
288
+
289
+  const { getFieldDecorator } = props.form
290
+  return (
291
+
292
+    <>
293
+      {/* style={{ display: 'none' }} */}
294
+      <div id="qrcode"></div>
295
+      <Form layout="inline" onSubmit={e => handleSubmit(e)}>
296
+        <Form.Item>
297
+          {getFieldDecorator('cityId')(
298
+            <SelectCity />,
299
+          )}
300
+        </Form.Item>
301
+        <Form.Item>
302
+          {getFieldDecorator('buildingId')(
303
+            <BuildSelect />,
304
+          )}
305
+        </Form.Item>
306
+        <Form.Item>
307
+          {getFieldDecorator('title')(
308
+            <Input
309
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
310
+              placeholder="请输入标题"
311
+            />,
312
+          )}
313
+        </Form.Item>
314
+        <Form.Item>
315
+          {getFieldDecorator('time')(
316
+            <DatePicker onChange={timeOnChange}/>,
317
+          )}
318
+        </Form.Item>
319
+        <Form.Item>
320
+          <AuthButton name="admin.buildingDynamic.search" noRight={null}>
321
+            <Button type="primary" htmlType="submit" className={styles.searchBtn}>
322
+              搜索
323
+            </Button>
324
+          </AuthButton>
325
+          <Button style={{ marginLeft: 8 }} onClick={handleReset}>
326
+            重置
327
+            </Button>
328
+        </Form.Item>
329
+      </Form>
330
+      <AuthButton name="admin.buildingDynamic.add.post" noRight={null}>
331
+        <Button type="danger" className={styles.addBtn} onClick={toAddHouse()}>新增</Button>
332
+      </AuthButton>
333
+      <Table
334
+        // onRow={record => {
335
+        //   return {
336
+        //     onClick: getActivityDetail(record.dynamicId),
337
+        //   };
338
+        // }}
339
+       dataSource={data.list} columns={columns} pagination={false} rowKey="activityList" />
340
+      <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
341
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={e => changePageNum(e)} current={data.current}/>
342
+      </div>
343
+    </>
344
+  )
345
+}
346
+const WrappedHeader = Form.create({ name: 'header' })(header);
347
+
348
+export default WrappedHeader

+ 0
- 0
src/pages/roomManager/roomInfo/roomInfo.jsx Datei anzeigen


+ 0
- 0
src/pages/roomManager/saleBatch/shareRecord.jsx Datei anzeigen


+ 0
- 0
src/pages/roomManager/saleBatch/visitRecord.jsx Datei anzeigen


+ 8
- 1
src/services/apis.js Datei anzeigen

@@ -1082,5 +1082,12 @@ export default {
1082 1082
      url: `${amapPrefix}/place/around`,
1083 1083
      method: 'GET',
1084 1084
    },
1085
- }
1085
+ },
1086
+ house: {
1087
+  list: {
1088
+    method: 'GET',
1089
+    url: `${prefix}/iBuildingDynamicList`,
1090
+    action: 'admin.iBuildingDynamicList.get',
1091
+  },
1092
+ },
1086 1093
 }