Преглед изворни кода

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

张延森 пре 5 година
родитељ
комит
1c28320254
59 измењених фајлова са 2577 додато и 853 уклоњено
  1. 9
    1
      config/config.js
  2. 6
    6
      config/routes.js
  3. 1
    1
      package.json
  4. 10
    14
      src/components/SelectButton/BuildSelect.jsx
  5. 73
    0
      src/components/XForm/FileUpload.jsx
  6. 6
    1
      src/components/XForm/ImageListUpload.jsx
  7. 1
    1
      src/pages/Welcome.jsx
  8. 50
    16
      src/pages/activity/ActivityList.jsx
  9. 51
    33
      src/pages/activity/drainage/Detail.jsx
  10. 118
    76
      src/pages/activity/drainage/DrainageList.jsx
  11. 96
    43
      src/pages/activity/editActivity.jsx
  12. 47
    7
      src/pages/activity/groupActivity/editGroupActivity.jsx
  13. 1
    0
      src/pages/activity/groupActivity/helpRecord.jsx
  14. 113
    107
      src/pages/activity/groupActivity/list.jsx
  15. 33
    8
      src/pages/activity/helpActivity/edithelpActivity.jsx
  16. 5
    1
      src/pages/activity/helpActivity/helpRecord.jsx
  17. 27
    37
      src/pages/activity/helpActivity/list.jsx
  18. 28
    9
      src/pages/building/list/add/components/amap.jsx
  19. 103
    0
      src/pages/building/list/add/components/amapAroundData.js
  20. 191
    24
      src/pages/building/list/add/components/base.jsx
  21. 275
    0
      src/pages/building/list/add/components/buildingImage.jsx
  22. 31
    19
      src/pages/building/list/add/components/imageSet.jsx
  23. 20
    31
      src/pages/building/list/add/components/modalImage.jsx
  24. 3
    2
      src/pages/building/list/add/components/poster.jsx
  25. 2
    1
      src/pages/building/list/add/components/share.jsx
  26. 30
    18
      src/pages/building/list/add/index.jsx
  27. 11
    10
      src/pages/building/list/index.jsx
  28. 3
    2
      src/pages/building/type/index.jsx
  29. 9
    8
      src/pages/carouselFigure/SelectNews.jsx
  30. 7
    7
      src/pages/carouselFigure/advertisingList.jsx
  31. 2
    2
      src/pages/carouselFigure/editAdvertising.jsx
  32. 7
    3
      src/pages/carouselFigure/editCarousel.jsx
  33. 0
    6
      src/pages/channel/channelList.jsx
  34. 18
    13
      src/pages/customer/customerlist/components/attribution.jsx
  35. 145
    0
      src/pages/customer/customerlist/components/recommend.jsx
  36. 88
    32
      src/pages/customer/customerlist/customerDetail.jsx
  37. 85
    15
      src/pages/customer/customerlist/index.jsx
  38. 137
    0
      src/pages/customer/customerlist/publicCustomerDetail.jsx
  39. 209
    0
      src/pages/customer/customerlist/publicStyle.less
  40. 64
    6
      src/pages/customer/customerlist/style.less
  41. 7
    5
      src/pages/customer/independentList/index.jsx
  42. 12
    4
      src/pages/customer/recommendCustomer/audit.jsx
  43. 30
    20
      src/pages/customer/recommendCustomer/components/attribution.jsx
  44. 4
    3
      src/pages/customer/report/index.jsx
  45. 1
    1
      src/pages/indexEcharts/components/UserBehavior.jsx
  46. 107
    74
      src/pages/indexEcharts/userBehavior.jsx
  47. 5
    1
      src/pages/indexEcharts/userSource.jsx
  48. 14
    14
      src/pages/integralMall/achieve.jsx
  49. 9
    2
      src/pages/integralMall/editGoods.jsx
  50. 2
    2
      src/pages/integralMall/writeOff.jsx
  51. 6
    4
      src/pages/news/list/editNewsList.jsx
  52. 18
    18
      src/pages/staff/list/editStaff.jsx
  53. 10
    5
      src/pages/style/GoodsList.less
  54. 164
    46
      src/pages/system/document/audit.jsx
  55. 25
    26
      src/pages/system/document/list.jsx
  56. 0
    62
      src/pages/system/document/see.jsx
  57. 2
    2
      src/pages/system/editPolicy.jsx
  58. 38
    0
      src/services/apis.js
  59. 8
    4
      src/utils/request.js

+ 9
- 1
config/config.js Прегледај датотеку

@@ -138,5 +138,13 @@ export default {
138 138
   },
139 139
   chainWebpack: webpackPlugin,
140 140
 
141
-  proxy,
141
+  proxy: {
142
+    ...proxy,
143
+    '/gaode_amap': { // 高德地图
144
+      // target: 'http://192.168.0.11:8080/',
145
+      target: 'https://restapi.amap.com/v3/',
146
+      changeOrigin: true,
147
+      pathRewrite: { '^/gaode_amap': '' },
148
+    },
149
+  },
142 150
 };

+ 6
- 6
config/routes.js Прегледај датотеку

@@ -128,6 +128,12 @@ export default [
128 128
                 name: '到访记录',
129 129
                 component: './customer/visiting/index',
130 130
               },
131
+              {
132
+                path: '/customer/customerlist/publicCustomerDetail',
133
+                name: '私客详情',
134
+                hideInMenu: true,
135
+                component: './customer/customerlist/publicCustomerDetail',
136
+              },
131 137
             ],
132 138
           },
133 139
           {
@@ -424,12 +430,6 @@ export default [
424 430
                 hideInMenu: true,
425 431
                 component: './system/document/audit',
426 432
               },
427
-              {
428
-                path: '/system/document/see',
429
-                name: '客户资料查看',
430
-                hideInMenu: true,
431
-                component: './system/document/see',
432
-              },
433 433
             ],
434 434
           },
435 435
           {

+ 1
- 1
package.json Прегледај датотеку

@@ -43,7 +43,7 @@
43 43
   "dependencies": {
44 44
     "@ant-design/pro-layout": "^4.5.9",
45 45
     "@antv/data-set": "^0.10.2",
46
-    "antd": "^3.20.0",
46
+    "antd": "^3.25.0",
47 47
     "classnames": "^2.2.6",
48 48
     "dayjs": "^1.8.16",
49 49
     "dva": "^2.4.1",

+ 10
- 14
src/components/SelectButton/BuildSelect.jsx Прегледај датотеку

@@ -19,14 +19,9 @@ function usePrevious(props) {
19 19
  * @param {*} props
20 20
  * @returns
21 21
  */
22
-const BuildingSelect = (props) => {
23
-  const [ data, setData ] = useState([])
24
-  const [ value, setValue ] = useState('')
25
-  // const preProps = usePrevious(props)
26
-
27
-  // if ((!preProps) && props.value != value) {
28
-  //   setValue(props.value)
29
-  // }
22
+const BuildingSelect = props => {
23
+  const [data, setData] = useState([])
24
+  const [value, setValue] = useState('')
30 25
 
31 26
   useEffect(() => {
32 27
     setValue(props.value)
@@ -34,10 +29,10 @@ const BuildingSelect = (props) => {
34 29
 
35 30
   useEffect(() => {
36 31
     getCityList();
37
-  },[])
32
+  }, [])
38 33
 
39
-  const getCityList = (e) => {
40
-    request({ ...apis.building.getList, params: {pageNum: 1,pageSize: 999}, }).then((data) => {
34
+  const getCityList = e => {
35
+    request({ ...apis.building.getList, params: { pageNum: 1, pageSize: 999 } }).then(data => {
41 36
         setData(data.records)
42 37
         // 默认选中第一个
43 38
         if (props.checkFirst) {
@@ -47,17 +42,18 @@ const BuildingSelect = (props) => {
47 42
     })
48 43
   }
49 44
 
50
-  const handleChange = (e) => {
45
+  const handleChange = e => {
51 46
     setValue(e)
52 47
     props.onChange(e)
53 48
   }
54 49
   // '' === value ? undefined : value
55 50
   return (
56 51
       <Select
52
+      {...props} 
57 53
       showSearch
58 54
       value={value}
59
-      style={{ width: '180px' }} 
60
-      placeholder="请选择项目" 
55
+      style={{ width: '180px' }}
56
+      placeholder="请选择项目"
61 57
       onChange={handleChange}
62 58
       filterOption={(input, option) =>
63 59
         option.props.children && option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0

+ 73
- 0
src/components/XForm/FileUpload.jsx Прегледај датотеку

@@ -0,0 +1,73 @@
1
+import React, { useState, useEffect } from 'react'
2
+import { Upload, Button, Icon } from 'antd';
3
+import { uploaderProps } from '../../utils/upload';
4
+
5
+/**
6
+ * value 数据的接收格式 [{ url: xxxxx.mp4 }]
7
+ * @param {*} props 
8
+ */
9
+function fileUpload(props) {
10
+
11
+  const { value } = props
12
+  console.log('fileUploadProps: ', props)
13
+  // eslint-disable-next-line react-hooks/rules-of-hooks
14
+  const [defaultFileList, setDefaultFileList] = useState([])
15
+
16
+  // eslint-disable-next-line react-hooks/rules-of-hooks
17
+  useEffect(() => {
18
+    setDefaultValue()
19
+  }, [props.value]);
20
+
21
+
22
+  function getFileList() {
23
+    console.log('fileUpload: ', value)
24
+    // value 数据的接收格式 [{ url: xxxxx.mp4 }, { url: xxxxx.jpg }]
25
+    return (value || []).filter(f => f !== undefined).map((img, inx) => ({ uid: inx, url: img, name: img.substring(img.lastIndexOf('/') + 1, img.length), status: 'done' }))
26
+  }
27
+
28
+  function setDefaultValue() {
29
+    if (!value) {
30
+      return;
31
+    }
32
+
33
+    setDefaultFileList(getFileList())
34
+  }
35
+
36
+  function onFileChange({ file, fileList }) {
37
+    console.log(file, fileList)
38
+    setDefaultFileList(fileList)
39
+    if (file.status === 'uploading') {
40
+      return
41
+    }
42
+
43
+    if (file.status === 'done' || file.status === 'removed') {
44
+
45
+      // 因为这个控件本身返回的数据格式 [{ ..., response: '服务器返回的数据' }]
46
+      // 但是 我这里自己用的时候 传入的数据是 [ 'xxxx.mp4', 'xxxx.jpg' ], 然后通过 getFileList() 转换成了 [{ url: 'xxx.mp4' }] 这样的格式
47
+
48
+      // 原因是因为 控件返回的数据 和 fileList 展示已经上传的数据 的格式字段不一样
49
+
50
+      const resFileList = fileList.filter(f => f.response !== undefined).map(i => i.response)
51
+      const tempFileList = fileList.filter(f => f.url !== undefined).map(i => i.url)
52
+      const resultList = tempFileList.concat(resFileList || [])
53
+      props.onChange(resultList)
54
+    }
55
+  }
56
+
57
+  return (
58
+    <>
59
+      <Upload
60
+        { ...uploaderProps }
61
+        {...props}
62
+        onChange={onFileChange}
63
+        fileList={defaultFileList}
64
+      >
65
+        <Button>
66
+          <Icon type="upload" /> {props.label}
67
+        </Button>
68
+      </Upload>
69
+    </>
70
+  )
71
+}
72
+
73
+export default fileUpload

+ 6
- 1
src/components/XForm/ImageListUpload.jsx Прегледај датотеку

@@ -3,6 +3,10 @@ import { Upload, Icon, Modal } from 'antd';
3 3
 import './style.less';
4 4
 import { uploaderProps } from '../../utils/upload';
5 5
 
6
+/**
7
+ * unlimited  属性表示上传图片无限制
8
+ * 例子: <ImageListUpload unlimited/>
9
+ */
6 10
 class ImageListUpload extends React.Component {
7 11
   state = {
8 12
     previewVisible: false,
@@ -79,7 +83,8 @@ class ImageListUpload extends React.Component {
79 83
           { ...uploaderProps }
80 84
           onSuccess={this.handleUploadSucess}
81 85
         >
82
-          {(fileList || images).length >= 8 ? null : uploadButton}
86
+          {/* unlimited 表示上传无限制数量 */}
87
+          {(this.props.unlimited && uploadButton) || ((fileList || images).length >= 8 ? null : uploadButton)}
83 88
         </Upload>
84 89
         <Modal visible={previewVisible} footer={null} onCancel={this.handleCancel}>
85 90
           <img alt="example" style={{ width: '100%' }} src={previewImage} />

+ 1
- 1
src/pages/Welcome.jsx Прегледај датотеку

@@ -54,7 +54,7 @@ const welcome = (props) => {
54 54
             borderRadius: '12px', width: '32%', marginRight: '2%'
55 55
           }}>
56 56
             <span style={{ fontSize: '24px', color: '#fff' }}>总注册用户 </span>
57
-            <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}>{(data.selectRegisteredCount && data.selectRegisteredCount + 95) || '0'}</span>
57
+            <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}>{data.selectRegisteredCount || '0'}</span>
58 58
           </div>
59 59
         }
60 60
         {checkData.includes('number_of_new_users') &&

+ 50
- 16
src/pages/activity/ActivityList.jsx Прегледај датотеку

@@ -17,6 +17,7 @@ const header = props => {
17 17
   // eslint-disable-next-line react-hooks/rules-of-hooks
18 18
   const [data, setData] = useState({ list: [], total: 0 })
19 19
   //   const [page, changePage] = useState({})
20
+  const [time, setTime] = useState('')
20 21
 
21 22
   // 查询列表
22 23
   const getList = params => {
@@ -70,12 +71,20 @@ const header = props => {
70 71
       dataIndex: 'title',
71 72
       key: 'title',
72 73
       align: 'center',
74
+      // width: '15%',
75
+      render:  (x, row) => <><div style={{overflow: 'hidden',textOverflow: 'ellipsis',whiteSpace: 'nowrap', width: '201px',title:'content'}}>{row.title}</div></>,
76
+      // width: '300px',
77
+      // ellipsis:'true'overflow: hidden; /*溢出隐藏*/
78
+// text-overflow: ellipsis; /*以省略号...显示*/
79
+// white-space: nowrap;
73 80
     },
74 81
     {
75 82
       title: '活动时间',
76 83
       dataIndex: 'startDate',
77 84
       key: 'startDate',
78 85
       align: 'center',
86
+      // width: '15%',
87
+      // width: '20%',
79 88
       render: (x, row) => <><span>{`${moment(row.startDate).format('YYYY-MM-DD')} —— ${moment(row.endDate).format('YYYY-MM-DD')}`}</span></>,
80 89
     },
81 90
     {
@@ -83,32 +92,44 @@ const header = props => {
83 92
       dataIndex: 'count',
84 93
       key: 'count',
85 94
       align: 'center',
95
+      // width: '10%',
96
+      // width: '6%',
86 97
     },
87 98
     {
88 99
       title: '阅读量',
89 100
       dataIndex: 'pvNum',
90 101
       key: 'pvNum',
91 102
       align: 'center',
103
+      // width: '10%',
92 104
     },
93 105
     {
94 106
       title: '转发量',
95 107
       dataIndex: 'shareNum',
96 108
       key: 'shareNum',
97 109
       align: 'center',
110
+      // width: '10%',
98 111
     },
99 112
     {
100 113
       title: '收藏数',
101 114
       dataIndex: 'saveNum',
102 115
       key: 'saveNum',
103 116
       align: 'center',
117
+      // width: '10%',
104 118
     },
105 119
     {
106
-      title: '状态',
120
+      title: '报名状态',
107 121
       dataIndex: 'activityStatus',
108 122
       key: 'activityStatus',
109 123
       align: 'center',
124
+      // width: '10%',
110 125
       render: activityStatus => <><span>{activityStatus == 0 ? '进行中' : activityStatus == 1 ? '未开始' : '已结束'}</span></>,
111 126
     },
127
+    {
128
+      title: '权重',
129
+      dataIndex: 'heavy',
130
+      key: 'heavy',
131
+      align: 'center',
132
+    },
112 133
     {
113 134
       title: '操作',
114 135
       dataIndex: 'handle',
@@ -117,24 +138,23 @@ const header = props => {
117 138
       render: (x, row) => (
118 139
         <>
119 140
           <AuthButton name="admin.SignList.get" noRight={null}>
120
-            <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={getSignList.bind(this, row.dynamicId)}>{row.isEnlist == '1' || row.isEnlist == '2' ? '报名记录' : ''}{ (row.isEnlist==1||row.isEnlist==2)  && <Icon type="snippets" className={styles.shoppingCart} />}</span>
141
+          {(row.activityStatus === 0 || row.activityStatus === 2) && <span style={{ color: '#1990FF',marginRight: '20px', cursor: 'pointer' }} onClick={getSignList.bind(this, row.dynamicId)}>{row.isEnlist == '1' ? '报名记录' : ''}{ (row.isEnlist==1)  && <Icon type="snippets" className={styles.shoppingCart} />}</span>}
121 142
           </AuthButton>
122 143
           <AuthButton name="admin.buildingDynamic.send.dynamicId.put" noRight={null}>
123
-            {row.activityStatus != 0 && <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={sendOrPublicDynamic.bind(this, row)}>{row.status === 1 ? '取消发布' : '发布'}<Icon type="close-circle" className={styles.edit} /></span>}
144
+            <span style={{ color: '#1990FF',marginRight: '20px', cursor: 'pointer' }} onClick={sendOrPublicDynamic.bind(this, row)}>{row.status === 1 ? '取消发布' : '发布'}<Icon type="close-circle" className={styles.edit} /></span>
124 145
           </AuthButton>
125 146
           <AuthButton name="admin.buildingDynamic.finish.put" noRight={null}>
126
-            {row.isEnlist == 1 && <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={finishDynamic.bind(this, row)}>结束活动<Icon type="poweroff" className={styles.edit} /></span>}
147
+            {row.activityStatus === 0 && <span style={{ color: '#1990FF',marginRight: '20px', cursor: 'pointer' }} onClick={finishDynamic.bind(this, row)}>结束活动<Icon type="poweroff" className={styles.edit} /></span>}
127 148
           </AuthButton>
128 149
           <AuthButton name="admin.buildingDynamic.update.put" noRight={null}>
129
-            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row)}>{row.weight === 1 ? '取消置顶' : '置顶'}<Icon type="vertical-align-top" className={styles.edit} /></span>
130
-            {row.isEnlist != 2 && <span style={{ color: '#FF925C', cursor: 'pointer' }} onClick={toEditGoods(row.dynamicId)}>编辑<Icon type="form" className={styles.edit} /></span>}
150
+            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row)}>{row.weight === 1 ? '取消标签' : '添加标签'}<Icon type="vertical-align-top" className={styles.edit} /></span>
151
+            {(row.activityStatus === 0 || row.activityStatus === 1) && <span style={{ color: '#FF925C',marginRight: '20px', cursor: 'pointer' }} onClick={toEditGoods(row.dynamicId)}>编辑<Icon type="form" className={styles.edit} /></span>}
131 152
           </AuthButton>
132
-          <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={newQrcode.bind(this, row)}>下载二维码<Icon type="qrcode" className={styles.shoppingCart} /></span>
153
+      {(row.activityStatus === 0 || row.activityStatus === 2) &&<span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={newQrcode.bind(this, row)}>{row.isEnlist === 1 && '下载二维码'} {row.isEnlist === 1 && <Icon type="qrcode" className={styles.shoppingCart} />}</span>}
133 154
         </>
134 155
       ),
135 156
     },
136 157
   ];
137
-
138 158
   const getSignList = dynamicId => {
139 159
     router.push({
140 160
       pathname: '/activity/SignList',
@@ -153,7 +173,7 @@ const header = props => {
153 173
         request({ ...apis.activity.finish, data: { dynamicId: row.dynamicId, top: '' } }).then(data => {
154 174
           console.log(data)
155 175
           message.info('操作成功!')
156
-          getList({ pageNum: 1, pageSize: 10 })
176
+          getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() })
157 177
         }).catch(err => {
158 178
           console.log(err)
159 179
           message.info(err.msg || err.message)
@@ -168,7 +188,7 @@ const header = props => {
168 188
     request({ ...apis.activity.weight, params: { dynamicId: row.dynamicId, weight } }).then(data => {
169 189
       console.log(data)
170 190
       message.info('操作成功!')
171
-      getList({ pageNum: 1, pageSize: 10 })
191
+      getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() })
172 192
     }).catch(err => {
173 193
       console.log(err)
174 194
       message.info(err.msg || err.message)
@@ -187,7 +207,7 @@ const header = props => {
187 207
   const cancelDynamic = row => {
188 208
     request({ ...apis.activity.cancel, urlData: { id: row.dynamicId } }).then(data => {
189 209
       message.info('操作成功!')
190
-      getList({ pageNum: 1, pageSize: 10 })
210
+      getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue()  })
191 211
     }).catch(err => {
192 212
       console.log(err)
193 213
       message.info(err.msg || err.message)
@@ -198,7 +218,7 @@ const header = props => {
198 218
   const sendDynamic = row => {
199 219
     request({ ...apis.activity.send, urlData: { id: row.dynamicId } }).then(data => {
200 220
       message.info('操作成功!')
201
-      getList({ pageNum: 1, pageSize: 10 });
221
+      getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() });
202 222
     }).catch(err => {
203 223
       console.log(err)
204 224
       message.info(err.msg || err.message)
@@ -206,15 +226,21 @@ const header = props => {
206 226
   }
207 227
 
208 228
   const changePageNum = pageNumber => {
209
-    getList({ pageNum: pageNumber, pageSize: 10 })
229
+    getList({ pageNum: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
210 230
   }
211 231
 
212 232
   // 提交事件
213
-  const handleSubmit = (e, props) => {
233
+  const handleSubmit = e => {
214 234
     e.preventDefault();
215 235
     props.form.validateFields((err, values) => {
216 236
       if (!err) {
217 237
         console.log('提交数据: ', values)
238
+        if (time) {
239
+          values.time = `${moment(time).format('YYYY-MM-DDT00:00:00.000')}Z`
240
+        } else {
241
+          values.time = null
242
+        }
243
+        
218 244
         getList({ pageNum: 1, pageSize: 10, ...values })
219 245
       }
220 246
     });
@@ -223,6 +249,14 @@ const header = props => {
223 249
   // 重置搜索
224 250
   function handleReset () {
225 251
     props.form.resetFields();
252
+    setTime('')
253
+    getList({ pageNum: 1, pageSize: 10 })
254
+  }
255
+
256
+  // 时间回调
257
+  function timeOnChange(date, dateString) {
258
+    console.log(date, dateString)
259
+    setTime(date)
226 260
   }
227 261
 
228 262
 
@@ -232,7 +266,7 @@ const header = props => {
232 266
     <>
233 267
       {/* style={{ display: 'none' }} */}
234 268
       <div id="qrcode"></div>
235
-      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
269
+      <Form layout="inline" onSubmit={e => handleSubmit(e)}>
236 270
         <Form.Item>
237 271
           {getFieldDecorator('cityId')(
238 272
             <SelectCity />,
@@ -253,7 +287,7 @@ const header = props => {
253 287
         </Form.Item>
254 288
         <Form.Item>
255 289
           {getFieldDecorator('time')(
256
-            <DatePicker />,
290
+            <DatePicker onChange={timeOnChange}/>,
257 291
           )}
258 292
         </Form.Item>
259 293
         <Form.Item>

+ 51
- 33
src/pages/activity/drainage/Detail.jsx Прегледај датотеку

@@ -8,6 +8,7 @@ import apis from '../../../services/apis';
8 8
 import request from '../../../utils/request';
9 9
 import { SSL_OP_SSLEAY_080_CLIENT_DH_BUG } from 'constants';
10 10
 import AuthButton from '../../../components/AuthButton';
11
+import { timeout } from 'q';
11 12
 
12 13
 
13 14
 const data = []
@@ -22,7 +23,6 @@ const header = (props) => {
22 23
   const [startDate, setStartDate] = useState('')
23 24
   const [endDate, setEndDate] = useState('')
24 25
   const [total, setTotal] = useState({})
25
-  let daterange = []
26 26
   // let content = {}
27 27
   useEffect(() => {
28 28
 
@@ -61,7 +61,7 @@ const header = (props) => {
61 61
         const r = {
62 62
 
63 63
           key: inx + 1,
64
-          createDate:row.createDate,
64
+          createDate: row.createDate,
65 65
           [`${col.key}`]: col.value,
66 66
           ...acc,
67 67
         }
@@ -72,14 +72,14 @@ const header = (props) => {
72 72
   }
73 73
 
74 74
   function tableTitle (data) {
75
-   tableTitle = eval('(' + data[0].content + ')')
75
+    tableTitle = eval('(' + data[0].content + ')')
76 76
     const cols = [{
77 77
       title: "提交时间",
78 78
       dataIndex: "createDate",
79 79
       key: "createDate",
80 80
       render: (x, row) => <><span>{`${moment(row.createDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
81 81
     }]
82
-    return cols.concat( tableTitle.map((item) => {
82
+    return cols.concat(tableTitle.map((item) => {
83 83
       const col = {
84 84
         title: item.label,
85 85
         dataIndex: item.key,
@@ -88,32 +88,34 @@ const header = (props) => {
88 88
       return col
89 89
     }))
90 90
   }
91
+  // function datalist () {
91 92
 
92
-
93
-  function datalist () {
94
-
95
-    gettaDrainageRecord({ pageNum: 1, pageSize: 10, drainageId: drainageId, startTime: fromTime(startDate), endTime: fromTime(endDate) })
96
-  }
93
+  //   gettaDrainageRecord({ pageNum: 1, pageSize: 10, drainageId: drainageId, startTime: Time(startDate), endTime: Time(endDate) })
94
+  // }
97 95
 
98 96
   function fromTime (str) {
99 97
     return str === '' ? null : `${moment(str).format('YYYY-MM-DDT00:00:00.000')}Z`
100 98
   }
101 99
 
100
+  function Time (str) {
101
+    return str === '' ? null : `${moment(str).format('YYYY-MM-DD')}`
102
+  }
103
+  // 2019-10-30T11:04:49
102 104
   function onChangetime (dates, dateStrings) {
103
-
105
+    console.log(dateStrings[1])
104 106
     setEndDate(dateStrings[1])
105 107
     setStartDate(dateStrings[0])
106 108
 
107 109
   }
108 110
 
109 111
   const changePageNum = pageNumber => {
110
-    gettaDrainageRecord({ pageNum: pageNumber, pageSize: 10, drainageId: drainageId, startTime: fromTime(startDate), endTime: fromTime(endDate) })
112
+    gettaDrainageRecord({ pageNum: pageNumber, pageSize: 10, drainageId: drainageId, startTime: Time(startDate), endTime: Time(endDate) })
111 113
   }
112 114
 
113 115
 
114 116
   function excelPort () {
115 117
     // const fieldsValue = getFieldsValue()
116
-  
118
+
117 119
     request({ ...apis.activity.exporttaDrainageRecord, params: { drainageId: drainageId, startTime: fromTime(startDate), endTime: fromTime(endDate) } })
118 120
       .then(response => {
119 121
         download(response)
@@ -137,29 +139,45 @@ const header = (props) => {
137 139
     link.click()
138 140
   }
139 141
 
142
+  function handleReset (e) {
143
+    console.log(e)
144
+    props.form.resetFields();
145
+    setEndDate('')
146
+    setStartDate('')
147
+  }
148
+
149
+  const handleSubmit = (e, props) => {
150
+    e.preventDefault();
151
+    gettaDrainageRecord({ pageNum: 1, pageSize: 10, drainageId: drainageId, startTime: Time(startDate), endTime: Time(endDate) })
152
+  }
153
+
140 154
   const { RangePicker } = DatePicker;
155
+  const { getFieldDecorator } = props.form
141 156
   return (
142 157
     <>
143
-
144
-      <RangePicker
145
-        style={{ width: '400px' }}
146
-        // ranges={{
147
-        //   Today: [moment(), moment()],
148
-        //   'This Month': [moment().startOf('month'), moment().endOf('month')],
149
-        // }}
150
-        // defaultValue={[moment(new Date(new Date().setDate((new Date().getDate() - 6))), 'YYYY-MM-DD HH:MM:SS'), moment(new Date(), 'YYYY-MM-DD HH:MM:SS')]}
151
-        showTime
152
-        onChange={onChangetime}
153
-      />
154
-      <Button type="primary" htmlType="submit" style={{ marginLeft: '30px', float: 'right' }} onClick={datalist}>
155
-        搜索
156
-      </Button>
157
-
158
+      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
159
+        <Form.Item label="提交时间">
160
+        {getFieldDecorator('time')(
161
+            <RangePicker showTime format="YYYY-MM-DD HH:mm:ss" 
162
+            showTime
163
+            onChange={onChangetime}
164
+            />,
165
+          )}
166
+        </Form.Item>
167
+        <Form.Item>
168
+          <Button type="primary" htmlType="submit" >
169
+            搜索
170
+          </Button>
171
+          <Button style={{ marginLeft: 8 }} onClick={handleReset}>
172
+            重置
173
+            </Button>
174
+        </Form.Item>
175
+      </Form>
158 176
       <div>
159 177
         <div style={{ display: 'flex', justifyContent: 'space-between' }}>
160
-         <div style={{ lineHeight: '92px', width: '600px', fontWeight: 'bold', fontSize: '18px' }}>
161
-            H5项目:{ name }
162
-         </div>
178
+          <div style={{ lineHeight: '92px', width: '600px', fontWeight: 'bold', fontSize: '18px' }}>
179
+            H5项目:{name}
180
+          </div>
163 181
           {/* H5项目名称 style={{ float: 'right', margin: '20px 0', zIndex: 1 }} */}
164 182
           <AuthButton name="admin.taDrainageRecord.export.get" noRight={null}>
165 183
             <Button type="primary" style={{ marginLeft: '30px', float: 'right', marginTop: '30px', marginBottom: '30px', zIndex: 1 }} onClick={excelPort}>导出数据</Button>
@@ -167,7 +185,7 @@ const header = (props) => {
167 185
         </div>
168 186
         <Table columns={columns} dataSource={datas} pagination={false} />
169 187
         <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
170
-          <Pagination showQuickJumper defaultCurrent={1} total={total.total} onChange={(e) => changePageNum(e)} current={total.current}/>
188
+          <Pagination showQuickJumper defaultCurrent={1} total={total.total} onChange={(e) => changePageNum(e)} current={total.current} />
171 189
         </div>
172 190
       </div>
173 191
 
@@ -177,6 +195,6 @@ const header = (props) => {
177 195
     </>
178 196
   )
179 197
 }
198
+const WrappedHeader = Form.create({ name: 'header' })(header);
180 199
 
181
-
182
-export default header
200
+export default WrappedHeader

+ 118
- 76
src/pages/activity/drainage/DrainageList.jsx Прегледај датотеку

@@ -19,21 +19,6 @@ const toEditList = (row) => () => {
19 19
   });
20 20
 }
21 21
 
22
-
23
-
24
-const data = [
25
-
26
-  {
27
-    Id: '1',
28
-    name: 'zls',
29
-    // StartTime:'',
30
-    // EndTime:'',
31
-    number: 33,
32
-  }
33
-
34
-
35
-];
36
-
37 22
 const header = (props) => {
38 23
   // const [data, setData] = useState({ data: [] })
39 24
   const [datas, setDatas] = useState([])//表格数据
@@ -72,7 +57,7 @@ const header = (props) => {
72 57
           gettaDrainage({ pageNum: 1, pageSize: 10 })
73 58
         }).catch((err) => {
74 59
           console.log('111111', err)
75
-          message.info(err.msg || err.message)
60
+          // message.info(err.msg || err.message)
76 61
         })
77 62
       }
78 63
     });
@@ -90,14 +75,18 @@ const header = (props) => {
90 75
       dataIndex: 'name',
91 76
       key: 'name',
92 77
       align: 'center',
93
-      render: (text, datas) => <AuthButton name="admin.taDrainage.id.put" noRight={null}><div style={{ color: '#66B3FF' }} onClick={() => addshowModal(datas)} >{datas.name}</div></AuthButton>
78
+      render: (text, datas) => <>
79
+
80
+        <div style={{ color: '#66B3FF' }} onClick={() => addshowModal(datas)} >{datas.name}</div>
81
+
82
+      </>
94 83
     },
95 84
     {
96 85
       title: 'appid',
97 86
       dataIndex: 'appid',
98 87
       key: 'appid',
99 88
       align: 'center',
100
-      // render: (text, datas) => <div style={ { color: '#66B3FF' } } onClick= {() => addshowModal(datas)} >{ datas.name }</div>,
89
+      // render: (text, datas) => <div style={ { color: '#66B3FF' } } onClick= {() => addshowModal(datas)} >{ datas.name }</div>, 
101 90
     },
102 91
     {
103 92
       title: 'secret',
@@ -113,7 +102,7 @@ const header = (props) => {
113 102
       align: 'center',
114 103
       render: (x, row) => (
115 104
         <>
116
-          <span>{row.createDate && moment(row.createDate).format('YYYY-MM-DD hh:mm:ss')}</span>
105
+          <span>{row.createDate && moment(row.createDate).format('YYYY-MM-DD HH:mm:ss')}</span>
117 106
         </>
118 107
       ),
119 108
     },
@@ -124,7 +113,7 @@ const header = (props) => {
124 113
       align: 'center',
125 114
       render: (x, row) => (
126 115
         <>
127
-          <span>{row.endDate && moment(row.endDate).format('YYYY-MM-DD hh:mm:ss')}</span>
116
+          <span>{row.endDate && moment(row.endDate).format('YYYY-MM-DD HH:mm:ss')}</span>
128 117
         </>
129 118
       ),
130 119
     },
@@ -158,61 +147,49 @@ const header = (props) => {
158 147
   const Forms = props => {
159 148
 
160 149
     console.log(date, '---------------')
161
-    console.log(formsdate, '---------------')
150
+    console.log(formsdate.name, '---------------')
162 151
     console.log(formsdate, '22222222')
163
-    const fields = [
164
-      {
165
-        label: 'H5项目名称',
166
-        name: 'name',
167
-        type: FieldTypes.Text,
168
-        placeholder: "请输入H5项目名称",
169
-        value: formsdate.name,
170
-
171
-      },
172
-      {
173
-        label: '截止时间',
174
-        name: 'endDate',
175
-        type: FieldTypes.DatePicker,
176
-        value: formsdate.endDate ? moment(formsdate.endDate, 'YYYY-MM-DD HH:mm') : null
177
-        // render: <DatePicker placeholder="截止时间" value= {formsdate.endDate} />,
178
-      },
179
-
180
-
181
-    ]
182
-
183
-    const handleSubmit = val => {
184
-      console.log(date, '111---------------')
185
-      console.log(formsdate, '111---------------')
186
-      console.log(formsdate, '11122222222')
187
-      // data: { ...submitValue }
188
-
189
-      console.log(formsdate.drainageId, '9999999999999')
190
-      if (formsdate.drainageId) {
191
-        // { ...apis.activity.deletetaDrainage,urlData: { id: drainageIid }, }
192
-        request({ ...apis.activity.updatetaDrainage, urlData: { id: formsdate.drainageId }, data: val }).then((data) => {
193
-          message.info('操作成功!')
194
-          // gettaDrainage({ pageNum: 1, pageSize: 10 })
195
-        }).catch((err) => {
196
-          console.log('111111', err)
197
-          message.info(err.msg || err.message)
198
-        })
199
-
200
-      } else {
201 152
 
202 153
 
203
-
204
-        request({ ...apis.activity.addtaDrainage, data: val }).then((data) => {
205
-          message.info("保存成功")
206
-          console.log(data, '22222')
207
-
208
-        }).catch((err) => {
209
-          message.error(err.msg || err.message)
210
-        })
154
+    const { formsDate } = props
155
+    useEffect(() => {
156
+      if (formsDate) {
157
+        props.form.setFieldsValue({ name: formsdate.name, endDate: formsdate.endDate ? moment(formsdate.endDate, 'YYYY-MM-DD HH:mm') : null })
211 158
       }
212
-      setDate({
213
-        visible: false,
159
+    }, [formsDate])
160
+
161
+
162
+    const handleSubmit = e => {
163
+      e.preventDefault();
164
+      props.form.validateFields((err, values) => {
165
+        if (!err) {
166
+          if (formsDate.drainageId) {
167
+            // { ...apis.activity.deletetaDrainage,urlData: { id: drainageIid }, }
168
+            request({ ...apis.activity.updatetaDrainage, urlData: { id: formsDate.drainageId }, data: values }).then((data) => {
169
+              message.info('操作成功!')
170
+              gettaDrainage({ pageNum: 1, pageSize: 10 })
171
+              setDate({
172
+                visible: false,
173
+              });
174
+            }).catch((err) => {
175
+              console.log('111111', err)
176
+              message.info(err.msg || err.message)
177
+            })
178
+
179
+          } else {
180
+
181
+            request({ ...apis.activity.addtaDrainage, data: values }).then((data) => {
182
+              message.info("操作成功")
183
+              gettaDrainage({ pageNum: 1, pageSize: 10 })
184
+              setDate({
185
+                visible: false,
186
+              });
187
+            }).catch((err) => {
188
+              message.error(err.msg || err.message)
189
+            })
190
+          }
191
+        }
214 192
       });
215
-      gettaDrainage({ pageNum: 1, pageSize: 10 })
216 193
     }
217 194
 
218 195
     const handleCancel = val => {
@@ -221,16 +198,73 @@ const header = (props) => {
221 198
       });
222 199
     }
223 200
 
224
-    return <XForm onSubmit={handleSubmit} onCancel={handleCancel} fields={fields}></XForm>
201
+    const tailFormItemLayout = {
202
+      wrapperCol: {
203
+        xs: {
204
+          span: 24,
205
+          offset: 0,
206
+        },
207
+        sm: {
208
+          span: 16,
209
+          offset: 8,
210
+        },
211
+      },
212
+    };
225 213
 
226
-  }
214
+    const formItemLayout = {
215
+      labelCol: {
216
+        xs: { span: 24 },
217
+        sm: { span: 8 },
218
+      },
219
+      wrapperCol: {
220
+        xs: { span: 24 },
221
+        sm: { span: 16 },
222
+      },
223
+    };
224
+
225
+    const { getFieldDecorator } = props.form;
226
+    {/* <XForm onSubmit={handleSubmit} onCancel={handleCancel} fields={fields} ></XForm> */ }
227
+
228
+    return <Form {...formItemLayout} onSubmit={handleSubmit}>
229
+
230
+
231
+      <Form.Item label="H5项目名称">
232
+        {getFieldDecorator('name')(
233
+          <Input
234
+            placeholder="请输入H5项目名称"
235
+          />,
236
+        )}
237
+      </Form.Item>
238
+      <Form.Item label="截止时间">
239
+        {getFieldDecorator('endDate')(
240
+          <DatePicker
241
+          // prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
242
+          // placeholder={formsdate.endDate}
243
+          // value= formsdate.endDate ? moment(formsdate.endDate, 'YYYY-MM-DD HH:mm') : null
244
+          />,
245
+        )}
246
+      </Form.Item>
247
+      <Form.Item {...tailFormItemLayout}>
248
+        <AuthButton name="admin.taDrainage.id.put" noRight={null}>
249
+          <Button type="primary" htmlType="submit" className={styles.searchBtn} onClick>
250
+            确定
251
+    </Button>
252
+        </AuthButton>
253
+        <Button style={{ marginLeft: 8 }} onClick={handleCancel}>
254
+          取消
255
+      </Button>
256
+      </Form.Item>
257
+    </Form>
227 258
 
259
+  }
260
+  const Formss = Form.create({ name: 'Forms' })(Forms);
228 261
 
229 262
 
230 263
 
231 264
   //重置搜索
232 265
   function handleReset () {
233 266
     props.form.resetFields();
267
+    gettaDrainage({ pageNum: 1, pageSize: 10 })
234 268
   }
235 269
 
236 270
 
@@ -247,7 +281,13 @@ const header = (props) => {
247 281
     console.log(formsdate, '22222222')
248 282
     setDate({
249 283
       visible: true,
284
+      title: "修改H5项目"
250 285
     });
286
+
287
+
288
+    console.log('form :', props.form)
289
+
290
+
251 291
   };
252 292
   function showModal () {
253 293
     setFormsDate({
@@ -257,6 +297,7 @@ const header = (props) => {
257 297
     })
258 298
     setDate({
259 299
       visible: true,
300
+      title: '新建H5项目'
260 301
     });
261 302
   };
262 303
   const changePageNum = pageNumber => {
@@ -296,7 +337,7 @@ const header = (props) => {
296 337
   }
297 338
 
298 339
   const { getFieldDecorator } = props.form;
299
-  const { visible, confirmLoading, ModalText } = date;
340
+  const { visible, confirmLoading, ModalText, title } = date;
300 341
   return (
301 342
     <>
302 343
       <div>
@@ -319,7 +360,7 @@ const header = (props) => {
319 360
               />,
320 361
             )}
321 362
           </Form.Item>
322
-          <Form.Item>
363
+          <Form.Item >
323 364
             <Button type="primary" htmlType="submit" className={styles.searchBtn} onClick>
324 365
               搜索
325 366
           </Button>
@@ -332,14 +373,15 @@ const header = (props) => {
332 373
           <Button type="danger" className={styles.addBtn} onClick={showModal}>新增</Button>
333 374
         </AuthButton>
334 375
         <Modal
335
-          title="新建H5项目"
376
+          title={title}
377
+
336 378
           visible={visible}
337 379
           //  onOk={handleOk}
338 380
           confirmLoading={confirmLoading}
339 381
           onCancel={handleCancel}
340 382
           footer={null}
341 383
         >
342
-          <Forms />
384
+          <Formss formsDate={formsdate} />
343 385
         </Modal>
344 386
         <Table columns={columns} dataSource={datas.records} pagination={false} rowKey="drainageList" />
345 387
         <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>

+ 96
- 43
src/pages/activity/editActivity.jsx Прегледај датотеку

@@ -16,7 +16,6 @@ import touxiang from '../../assets/touxiang.jpg';
16 16
 import poster1 from '../../assets/poster1.png';
17 17
 import poster2 from '../../assets/poster2.png';
18 18
 import xiaochengxu from '../../assets/xiaochengxu.png'
19
-import PosterCard from '../../components/Cards/PosterCard'
20 19
 
21 20
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
22 21
 const { TextArea } = Input;
@@ -28,9 +27,10 @@ const formItemLayout = {
28 27
 
29 28
 const BasicForm = props => {
30 29
   const [isEnlist, setIsEnlist] = useState(1)
30
+  const [activityStatus, setActivityStatus] = useState(1)
31
+  const [disable, setDisable] = useState(false)
31 32
 
32 33
   const radioOnChange = e => {
33
-    // console.log(e.target.value)
34 34
     setIsEnlist(e.target.value)
35 35
   }
36 36
 
@@ -44,6 +44,8 @@ const BasicForm = props => {
44 44
       data.signupTime = [moment(data.enlistStart), moment(data.enlistEnd)]
45 45
 
46 46
       setIsEnlist(data.isEnlist)
47
+      setActivityStatus(data.activityStatus)
48
+      setDisable(data.activityStatus === 0 ? true : false)
47 49
       props.form.setFieldsValue(data)
48 50
     })
49 51
   }
@@ -104,11 +106,27 @@ const BasicForm = props => {
104 106
               message: '请选择所属项目',
105 107
             },
106 108
           ],
107
-        })(<BuildSelect />)}
109
+        })(<BuildSelect disabled={disable}/>)}
108 110
         </Form.Item>
109
-        <Form.Item label="主图">
110
-          {getFieldDecorator('imgUrl')(<ImageUploader />)}
111
-          <span>建议图片尺寸:750px*560px</span>
111
+        <Form.Item label="活动封面图1" help="建议图片尺寸:750px*420px,比例16:9,格式:jpg,用于活动列表">
112
+          {getFieldDecorator('listImgUrl', {
113
+          rules: [
114
+            {
115
+              required: true,
116
+              message: '请选择活动封面图1',
117
+            },
118
+          ],
119
+        })(<ImageUploader />)}
120
+        </Form.Item>
121
+        <Form.Item label="活动详情主图" help="建议图片尺寸:750*600px,比例5:4,格式:jpg,用于普通活动详情">
122
+          {getFieldDecorator('imgUrl', {
123
+          rules: [
124
+            {
125
+              required: true,
126
+              message: '请选择活动详情主图',
127
+            },
128
+          ],
129
+        })(<ImageUploader />)}
112 130
         </Form.Item>
113 131
         <Form.Item label="活动标题">
114 132
         {getFieldDecorator('title', {
@@ -118,7 +136,7 @@ const BasicForm = props => {
118 136
               message: '请输入活动标题',
119 137
             },
120 138
           ],
121
-        })(<Input />)}
139
+        })(<Input/>)}
122 140
         </Form.Item>
123 141
         <Form.Item label="活动时间">
124 142
         {getFieldDecorator('activityTime', {
@@ -128,7 +146,7 @@ const BasicForm = props => {
128 146
               message: '请选择活动时间',
129 147
             },
130 148
           ],
131
-        })(<RangePicker format="YYYY-MM-DD HH:mm" />)}
149
+        })(<RangePicker format="YYYY-MM-DD HH:mm" disabled={activityStatus===0 ? true : false}/>)}
132 150
         </Form.Item>
133 151
         <Form.Item label="活动地点">
134 152
         {getFieldDecorator('address', {
@@ -138,7 +156,7 @@ const BasicForm = props => {
138 156
               message: '请输入活动地点',
139 157
             },
140 158
           ],
141
-        })(<Input />)}
159
+        })(<Input disabled={activityStatus===0 ? true : false}/>)}
142 160
         </Form.Item>
143 161
         <Form.Item label="活动人数">
144 162
         {getFieldDecorator('personNum', {
@@ -148,7 +166,7 @@ const BasicForm = props => {
148 166
               message: '请输入活动人数',
149 167
             },
150 168
           ],
151
-        })(<Input type="number" />)}
169
+        })(<Input type="number" disabled={activityStatus===0 ? true : false}/>)}
152 170
         </Form.Item>
153 171
         <Form.Item label="最大报名人数">
154 172
         {getFieldDecorator('maxEnlistByPerson', {
@@ -158,21 +176,12 @@ const BasicForm = props => {
158 176
               message: '请输入最大报名人数',
159 177
             },
160 178
           ],
161
-        })(<Input type="number" />)}
179
+        })(<Input type="number" disabled={activityStatus===0 ? true : false}/>)}
162 180
         </Form.Item>
163 181
         <Form.Item label="活动详情">
164 182
         {getFieldDecorator('desc')(<Wangedit />)}
165 183
         </Form.Item>
166
-        <Form.Item label="是否需要报名">
167
-        {getFieldDecorator('isEnlist')(
168
-          <Radio.Group onChange={(e) => radioOnChange(e)}>
169
-            <Radio value={1}>是</Radio>
170
-            <Radio value={0}>否</Radio>
171
-          </Radio.Group>,
172
-        )}
173
-        </Form.Item>
174
-        {
175
-          isEnlist === 1 && (<Form.Item label="报名时间">
184
+        <Form.Item label="报名时间">
176 185
           {getFieldDecorator('signupTime', {
177 186
             rules: [
178 187
               {
@@ -180,9 +189,18 @@ const BasicForm = props => {
180 189
                 message: '请选择报名时间',
181 190
               },
182 191
             ],
183
-          })(<RangePicker format="YYYY-MM-DD HH:mm" />)}
184
-          </Form.Item>)
185
-        }
192
+          })(<RangePicker format="YYYY-MM-DD HH:mm" disabled={activityStatus===0 ? true : false}/>)}
193
+        </Form.Item>  
194
+        <Form.Item label="权重">
195
+        {getFieldDecorator('heavy', {
196
+          rules: [
197
+            {
198
+              required: true,
199
+              message: '请输入权重',
200
+            },
201
+          ],
202
+        })(<Input type="number" disabled={activityStatus===0 ? true : false} style={{ width: 80}}/>)}<span style={{ marginLeft: 30, color:'grey'}}>数字越大越靠前</span>
203
+        </Form.Item>
186 204
         <Form.Item wrapperCol={{ span: 12, offset: 8 }}>
187 205
           <Button type="primary" htmlType="submit">
188 206
             确认
@@ -224,13 +242,13 @@ const Edit = props => {
224 242
     if (dynamicId) {
225 243
       console.log(dynamicId, 'dynamicId')
226 244
       useEffect(() => {
227
-        request({ ...apis.activity.usedPoster, params: { targetId: dynamicId, targetType: 'activity' } }).then((data) => {
245
+        request({ ...apis.activity.poster, params: { targetId: dynamicId, targetType: 'activity' } }).then((data) => {
228 246
           console.log(data, "2222")
229
-          if (data) {
230
-            setPosterId(data.posterId)
231
-            changeImg(data.posterImg)
232
-            changeTextArea(data.posterDescription)
233
-            changeInput(data.posterTitle)
247
+          if (data.length > 0) {
248
+            setPosterId(data[0].posterId)
249
+            changeImg(data[0].posterImg)
250
+            changeTextArea(data[0].posterDescription)
251
+            changeInput(data[0].posterTitle)
234 252
           }
235 253
         }).catch((err) => {
236 254
           message.info(err.msg || err.message)
@@ -249,24 +267,16 @@ const Edit = props => {
249 267
       })
250 268
     }
251 269
 
252
-    //获取选中的模板
253
-    const [ checkList, setCheckList ] = useState([])
254
-
255
-    const cardChange = (e) => {
256
-      console.log(e,"123")
257
-      setCheckList(e)
258
-    }
259
-
260 270
     const submitPoster = () => {
261 271
       if (dynamicId) {
262 272
         if (posterId) {
263
-          request({ ...apis.activity.updatePoster, urlData: { id: posterId }, data: { targetId: dynamicId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue, templateIds: checkList }, }).then((data) => {
273
+          request({ ...apis.activity.updatePoster, urlData: { id: posterId }, data: { targetId: dynamicId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
264 274
             message.info("保存成功")
265 275
           }).catch((err) => {
266 276
             message.info(err.msg || err.message)
267 277
           })
268 278
         } else {
269
-          request({ ...apis.activity.addPoster, data: { targetId: dynamicId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue, templateIds: checkList }, }).then((data) => {
279
+          request({ ...apis.activity.addPoster, data: { targetId: dynamicId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
270 280
             setPosterId(data.posterId)
271 281
             message.info("保存成功")
272 282
           }).catch((err) => {
@@ -281,14 +291,56 @@ const Edit = props => {
281 291
     return <div>
282 292
       <div style={{ display: 'flex' }}>
283 293
         <div style={{ width: '420px', height: '900px', display: 'inline-block', marginTop: '30px' }}>
284
-           <PosterCard postType="dynamic"  checkedList={checkList} onChange={cardChange} />
294
+          <div style={{ width: '375px', height: '700px', backgroundColor: '#fff', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
295
+            <img style={{ width: '100%', height: '300px' }} src={imgValue ? imgValue : poster1} alt="" />
296
+            <div style={{ display: 'flex', alignItems: 'center', marginTop: '-24px' }}>
297
+              <img style={{ width: '70px', height: '70px', border: '4px solid #fff', borderRadius: '35px', marginLeft: '16px' }} src={touxiang} alt="" />
298
+              <span style={{ color: '#222', fontWeight: '600', margin: '24px 10px 0 14px', fontSize: '17px' }}>喵喵</span>
299
+              <span style={{ color: '#999', marginTop: '25px', fontSize: '17px' }}>邀您参与</span>
300
+              <span style={{ color: '#999', margin: '25px 0 0 60px', fontSize: '17px' }}>2019.09.21</span>
301
+            </div>
302
+            <p style={{
303
+              margin: '10px 20px',
304
+              fontSize: '20px',
305
+              color: '#222',
306
+              fontWeight: '600',
307
+              display: '-webkit-box',
308
+              lineClamp: '3',
309
+              height: '60px',
310
+              WebkitLineClamp: '2',
311
+              WebkitBoxOrient: 'vertical',
312
+              overflow: 'hidden',
313
+              textOverflow: 'ellipsis'
314
+            }}>{inputValue ? inputValue : '海报标题'}</p>
315
+
316
+            <img src={yinhao} style={{ width: '30px', marginLeft: '20px' }} alt="" />
317
+            <p style={{
318
+              margin: '16px 20px 28px 20px',
319
+              fontSize: '17px',
320
+              color: '#999',
321
+              display: '-webkit-box',
322
+              lineClamp: '3',
323
+              height: '72px',
324
+              WebkitLineClamp: '3',
325
+              WebkitBoxOrient: 'vertical',
326
+              overflow: 'hidden',
327
+              textOverflow: 'ellipsis'
328
+            }}>{textAreaValue ? textAreaValue : '海报描述'}</p>
329
+            <div style={{ backgroundColor: '#f1f1f1', padding: '22px 30px', boxShadow: '0px 6px 12px -4px #dcdcdc', position: 'relative' }}>
330
+              <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>长按识别小程序码</p>
331
+              <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>进入<span style={{ margin: '0 5px', fontSize: '18px', color: '#333', fontWeight: '600' }}>{miniappName || '置业V顾问'}</span>报名活动</p>
332
+              <img style={{ width: '80px', position: 'absolute', right: '30px', top: '10px' }} src={xiaochengxu} alt="" />
333
+            </div>
334
+          </div>
335
+          <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
285 336
         </div>
286 337
 
287 338
         <div >
288 339
           <div style={{ display: 'flex', width: '100%', margin: '60px 0' }}>
289
-            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报图片</p>
340
+            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>活动海报图</p>
290 341
             <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
291 342
           </div>
343
+          <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于普通活动海报</p>
292 344
           <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
293 345
             <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
294 346
             <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
@@ -363,9 +415,10 @@ const Edit = props => {
363 415
         <Input placeholder="请输入分享标题" value={inputValue} onChange={e => changeInput(e.target.value)} />
364 416
       </div>
365 417
       <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
366
-        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享图</p>
418
+        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>活动分享图</p>
367 419
         <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
368 420
       </div>
421
+      <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginTop: '20px' }}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于活动分享好友</p>
369 422
       <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
370 423
       <Button onClick={() => router.go(-1)}>取消</Button>
371 424
     </div>

+ 47
- 7
src/pages/activity/groupActivity/editGroupActivity.jsx Прегледај датотеку

@@ -32,6 +32,9 @@ const Edit = props => {
32 32
   const { groupActivityId } = props.location.query
33 33
   const [dynamicData, setDynamicData] = useState({ isEnlist: 1 })
34 34
   const [scoreData, setScoreData] = useState({})
35
+  const [activityStatus, setActivityStatus] = useState({})
36
+  const [disable, setDisable] = useState(false)
37
+
35 38
   useEffect(() => {
36 39
     request(apis.groupActivity.avgScore).then((data) => {
37 40
       setScoreData(data);
@@ -46,6 +49,8 @@ const Edit = props => {
46 49
     const getDynamicData = (groupActivityId) => {
47 50
       request({ ...apis.groupActivity.details, urlData: { id: groupActivityId } }).then((data) => {
48 51
         setDynamicData(data)
52
+        setActivityStatus(data.activityStatus)
53
+        setDisable(data.activityStatus === 0 ? true : false)
49 54
       })
50 55
     }
51 56
   }
@@ -65,7 +70,7 @@ const Edit = props => {
65 70
       {
66 71
         label: '选择项目',
67 72
         name: 'buildingId',
68
-        render: <BuildSelect />,
73
+        render: <BuildSelect disabled={disable}/>,
69 74
         value: dynamicData.buildingId,
70 75
         rules: [
71 76
           { required: true, message: '请选择项目' },
@@ -81,21 +86,41 @@ const Edit = props => {
81 86
         ]
82 87
       },
83 88
       {
84
-        label: '活动主图',
89
+        label: '拼团详情主图',
85 90
         name: 'mainImg',
86 91
         type: FieldTypes.ImageUploader,
87 92
         value: dynamicData.mainImg,
88 93
         rules: [
89
-          { required: true, message: '请输入活动主图' },
94
+          { required: true, message: '请输入拼团详情主图' },
95
+        ],
96
+        help: '建议图片尺寸:750*600px,比例5:4,格式:jpg,用于拼团活动详情',
97
+      },
98
+      {
99
+        label: '拼团封面图1',
100
+        name: 'listImg',
101
+        type: FieldTypes.ImageUploader,
102
+        value: dynamicData.listImg,
103
+        rules: [
104
+          { required: true, message: '请输入拼团封面图1' },
90 105
         ],
91
-        help: '建议尺寸375*312px',
106
+        help: '建议图片尺寸:750*420px,比例16:9,格式:jpg,用于活动列表',
107
+      },
108
+      {
109
+        label: '拼团封面图2',
110
+        name: 'bannerListImg',
111
+        type: FieldTypes.ImageUploader,
112
+        value: dynamicData.bannerListImg,
113
+        rules: [
114
+          { required: true, message: '请输入拼团封面图2' },
115
+        ],
116
+        help: '建议图片尺寸:670*224px,比例3:1,格式:jpg,用于首页底部活动轮播',
92 117
       },
93 118
       {
94 119
         label: '活动时间',
95 120
         name: 'activityTime',
96 121
         type: FieldTypes.RangePicker,
97 122
         value: dynamicData.startTime != null ? [moment(dynamicData.startTime, 'YYYY-MM-DD HH:mm'), moment(dynamicData.endTime, 'YYYY-MM-DD HH:mm')] : null,
98
-        props: { showTime: { format: 'HH:mm' } },
123
+        props: { showTime: { format: 'HH:mm' }, disabled: activityStatus === 0 ? true : false },
99 124
         rules: [
100 125
           { required: true, message: '请选择活动时间' },
101 126
         ],
@@ -105,6 +130,7 @@ const Edit = props => {
105 130
         name: 'groupBuyPeople',
106 131
         type: FieldTypes.Text,
107 132
         value: dynamicData.groupBuyPeople,
133
+        props: {disabled: activityStatus === 0 ? true : false },
108 134
         help: '注:成团所需人数',
109 135
         rules: [
110 136
           { required: true, message: '请输入成团人数' },
@@ -115,6 +141,7 @@ const Edit = props => {
115 141
         name: 'integral',
116 142
         type: FieldTypes.Text,
117 143
         value: dynamicData.integral,
144
+        props: {disabled: activityStatus === 0 ? true : false },
118 145
         help: '注:用户平均积分' + scoreData.averageScore,
119 146
         rules: [
120 147
           { required: true, message: '请输入所需积分' },
@@ -130,6 +157,17 @@ const Edit = props => {
130 157
         ],
131 158
         help: '建议宽度:335px,高度不限',
132 159
       },
160
+      {
161
+        label: '权重',
162
+        name: 'heavy',
163
+        type: FieldTypes.Number,
164
+        render: <Input type="number" style={{ width: 80}}/>,
165
+        value: dynamicData.heavy,
166
+        rules: [
167
+          { required: true, message: '请输入权重' },
168
+        ],
169
+        help: '数字越大越靠前',
170
+      },
133 171
     ]
134 172
 
135 173
     const handleSubmit = val => {
@@ -254,9 +292,10 @@ const Edit = props => {
254 292
 
255 293
         <div >
256 294
           <div style={{ display: 'flex', width: '100%', margin: '60px 0' }}>
257
-            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报图</p>
295
+            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>拼团海报图</p>
258 296
             <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
259 297
           </div>
298
+          <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于拼团活动海报</p>
260 299
           <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
261 300
             <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
262 301
             <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
@@ -331,9 +370,10 @@ const Edit = props => {
331 370
         <Input placeholder="请输入分享标题" value={inputValue} onChange={e => changeInput(e.target.value)} />
332 371
       </div>
333 372
       <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
334
-        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享图</p>
373
+        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>拼团分享图</p>
335 374
         <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
336 375
       </div>
376
+      <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于拼团活动分享好友</p>
337 377
       <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
338 378
       <Button onClick={() => router.go(-1)}>取消</Button>
339 379
     </div>

+ 1
- 0
src/pages/activity/groupActivity/helpRecord.jsx Прегледај датотеку

@@ -109,6 +109,7 @@ class InviteTable extends React.Component {
109 109
         dataIndex: 'createTime',
110 110
         key: 'createTime',
111 111
         align: 'center',
112
+        render: (x, row) => <><span>{row.createTime ? `${moment(row.createTime).format('YYYY-MM-DD HH:mm:ss')}`:''}</span></>,
112 113
       },
113 114
     ]
114 115
     return (

+ 113
- 107
src/pages/activity/groupActivity/list.jsx Прегледај датотеку

@@ -14,25 +14,25 @@ const { Option } = Select;
14 14
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
15 15
 
16 16
 const header = props => {
17
-  const [ data, setData ] = useState({})
18
-//   const [page, changePage] = useState({})
17
+  const [data, setData] = useState({})
18
+  //   const [page, changePage] = useState({})
19 19
 
20 20
   useEffect(() => {
21 21
     getList({ pageNum: 1, pageSize: 10 });
22
-  },[])
22
+  }, [])
23 23
 
24 24
   // 查询列表
25 25
   const getList = (params) => {
26
-      console.log(params);
26
+    console.log(params);
27 27
     request({ ...apis.groupActivity.list, params: { ...params } }).then((data) => {
28
-        console.log(data)
29
-        setData(data)
28
+      console.log(data)
29
+      setData(data)
30 30
     })
31 31
   }
32 32
 
33
-  
34
-// 跳转到拼团活动新增
35
-const toEditActivity = (groupActivityId) => () => {
33
+
34
+  // 跳转到拼团活动新增
35
+  const toEditActivity = (groupActivityId) => () => {
36 36
     router.push({
37 37
       pathname: '/activity/groupActivity/editGroupActivity',
38 38
       query: {
@@ -40,14 +40,14 @@ const toEditActivity = (groupActivityId) => () => {
40 40
       },
41 41
     });
42 42
   }
43
-  
43
+
44 44
   /**
45 45
    *
46 46
    *
47 47
    * @param {*} props
48 48
    * @returns
49 49
    */
50
-  
50
+
51 51
   const columns = [
52 52
     {
53 53
       title: '活动标题',
@@ -63,11 +63,11 @@ const toEditActivity = (groupActivityId) => () => {
63 63
       render: (x, row) => <><span>{`${moment(row.startTime).format('YYYY-MM-DD HH:mm:ss')} —— ${moment(row.endTime).format('YYYY-MM-DD HH:mm:ss')}`}</span></>
64 64
     },
65 65
     {
66
-        title: '所需积分',
67
-        dataIndex: 'integral',
68
-        key: 'integral',
69
-        align: 'center',
70
-      },
66
+      title: '所需积分',
67
+      dataIndex: 'integral',
68
+      key: 'integral',
69
+      align: 'center',
70
+    },
71 71
     {
72 72
       title: '已参与人数',
73 73
       dataIndex: 'participateNum',
@@ -79,7 +79,7 @@ const toEditActivity = (groupActivityId) => () => {
79 79
       dataIndex: 'groupBuyPeople',
80 80
       key: 'groupBuyPeople',
81 81
       align: 'center',
82
-    },  
82
+    },
83 83
     {
84 84
       title: '状态',
85 85
       dataIndex: 'activityStatus',
@@ -99,127 +99,132 @@ const toEditActivity = (groupActivityId) => () => {
99 99
       render: (x, row) => (
100 100
         <>
101 101
           {row.activityStatus === 0 &&
102
-          <AuthButton name="admin.taShareActivity.finish.put" noRight={null}><span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={endGroupActivity(row)}>结束活动<Icon type="poweroff" className={styles.edit} /></span></AuthButton>
103
-          }
104
-          {row.activityStatus === 0 &&
105
-          <AuthButton name="admin.taShareSuccessRecord.get" noRight={null}>    <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={ getSignList.bind(this, row.groupActivityId)}>拼团记录<Icon type="snippets" className={styles.shoppingCart} /></span></AuthButton>
102
+            <AuthButton name="admin.taShareActivity.finish.put" noRight={null}><span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={endGroupActivity(row)}>结束活动<Icon type="poweroff" className={styles.edit} /></span></AuthButton>
106 103
           }
107
-          {row.activityStatus === 0 &&
108
-          <AuthButton name="admin.taShareActivity.list.get" noRight={null}>
109
-            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topGroupActivity(row, row.weight)}>{ row.weight === 1 ? '取消置顶' : '置顶' }<Icon type="vertical-align-top" className={styles.edit} /></span>
110
-            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={recommendGroupActivity(row)}>{ row.sort === true ? '取消推荐首页' : '推荐首页' }<Icon type="vertical-align-top" className={styles.edit} /></span>
111
-        </AuthButton> }
112
-
113
-          {row.activityStatus === 1 &&
114
-          <AuthButton name="admin.taShareActivity.update.put" noRight={null}>
115
-            <span style={{ color: '#FF925C', cursor: 'pointer' }} onClick={toEditActivity(row.groupActivityId)}>编辑<Icon type="form" className={styles.edit} /></span>
116
-          </AuthButton>
104
+          {(row.activityStatus === 0 || row.activityStatus === 2)&&
105
+            <AuthButton name="admin.taShareSuccessRecord.get" noRight={null}>
106
+              <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={getSignList.bind(this, row.groupActivityId)}>拼团记录<Icon type="snippets" className={styles.shoppingCart} /></span>
107
+            </AuthButton>
117 108
           }
118
-           {row.activityStatus === 1 &&
119
-          <AuthButton name="admin.taShareActivity.finish.put" noRight={null}>
120
-                <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={endGroupActivity(row)}>结束活动<Icon type="poweroff" className={styles.edit} /></span>
121
-          </AuthButton>
122
-          }
123
-           {row.activityStatus === 1 &&
124
-           <AuthButton name="admin.taShareActivity.weight.put" noRight={null}>
125
-                <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topGroupActivity(row, row.weight)}>{ row.weight === 1 ? '取消置顶' : '置顶' }<Icon type="vertical-align-top" className={styles.edit} /></span>
126
-                <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={recommendGroupActivity(row)}>{ row.sort === true ? '取消推荐首页' : '推荐首页' }<Icon type="vertical-align-top" className={styles.edit} /></span>
127
-        </AuthButton>
109
+          {
110
+            <AuthButton name="admin.buildingDynamic.send.dynamicId.put" noRight={null}>
111
+              <span style={{ color: '#1990FF',marginRight: '20px', cursor: 'pointer' }} onClick={sendOrPublicDynamic.bind(this, row)}>{row.status === 1 ? '取消发布' : '发布'}<Icon type="close-circle" className={styles.edit} /></span>
112
+            </AuthButton>
128 113
           }
114
+          {
115
+            <AuthButton name="admin.taShareActivity.list.get" noRight={null}>
116
+              <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topGroupActivity(row, row.weight)}>{row.weight === 1 ? '取消标签' : '添加标签'}<Icon type="vertical-align-top" className={styles.edit} /></span>
117
+              <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={recommendGroupActivity(row)}>{row.sort === true ? '取消推荐首页' : '推荐首页'}<Icon type="vertical-align-top" className={styles.edit} /></span>
118
+            </AuthButton>}
129 119
 
130
-        {row.activityStatus === 2 &&
131
-        <AuthButton><span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={ getSignList.bind(this, row.groupActivityId)}>拼团记录<Icon type="snippets" className={styles.shoppingCart} /></span></AuthButton>
132
-        }
133
-         {row.activityStatus === 2 &&
134
-        <AuthButton name="admin.taShareActivity.weight.put" noRight={null}>
135
-            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topGroupActivity(row, row.weight)}>{ row.weight === 1 ? '取消置顶' : '置顶' }<Icon type="vertical-align-top" className={styles.edit} /></span>
136
-            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={recommendGroupActivity(row)}>{ row.sort === true ? '取消推荐首页' : '推荐首页' }<Icon type="vertical-align-top" className={styles.edit} /></span>
137
-        </AuthButton>
120
+          {(row.activityStatus === 0 || row.activityStatus === 1) &&
121
+            <AuthButton name="admin.taShareActivity.update.put" noRight={null}>
122
+              <span style={{ color: '#FF925C', marginRight: '20px', cursor: 'pointer' }} onClick={toEditActivity(row.groupActivityId)}>编辑<Icon type="form" className={styles.edit} /></span>
123
+            </AuthButton>
138 124
           }
139 125
         </>
140 126
       ),
141 127
     },
142 128
   ];
143 129
   const getSignList = groupActivityId => {
144
-      router.push({
145
-          pathname: '/activity/groupActivity/helpRecord',
146
-          query: {
147
-            groupActivityId,
148
-          },
149
-        });
130
+    router.push({
131
+      pathname: '/activity/groupActivity/helpRecord',
132
+      query: {
133
+        groupActivityId,
134
+      },
135
+    });
150 136
   }
151
-  
137
+
152 138
   const finishDynamic = (row) => {
153
-      Modal.confirm({
154
-          title: '结束以后将无法编辑, 是否继续?',
155
-          okText: '确定',
156
-          cancelText: '取消',
157
-          onOk() {
158
-              request({ ...apis.activity.finish, data: {dynamicId: row.dynamicId, top: ""} }).then((data) => {
159
-                  console.log(data)
160
-                  message.info('操作成功!')
161
-                  getList({ pageNum: 1, pageSize: 10 })
162
-              }).catch((err) => {
163
-                  console.log(err)
164
-                  message.info(err.msg || err.message)
165
-              })
166
-          },
167
-        });
168
-  }
169
-  
170
-  //结束活动
171
-  const endGroupActivity = (row) => () => {
172
-      request({ ...apis.groupActivity.finish, urlData: { id: row.groupActivityId} }).then((data) => {
139
+    Modal.confirm({
140
+      title: '结束以后将无法编辑, 是否继续?',
141
+      okText: '确定',
142
+      cancelText: '取消',
143
+      onOk () {
144
+        request({ ...apis.activity.finish, data: { dynamicId: row.dynamicId, top: "" } }).then((data) => {
173 145
           console.log(data)
174 146
           message.info('操作成功!')
175
-          getList({ pageNum: 1, pageSize: 10 })
176
-      }).catch((err) => {
147
+          getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() })
148
+        }).catch((err) => {
177 149
           console.log(err)
178 150
           message.info(err.msg || err.message)
179
-      })
151
+        })
152
+      },
153
+    });
154
+  }
155
+
156
+  //结束活动
157
+  const endGroupActivity = (row) => () => {
158
+    request({ ...apis.groupActivity.finish, urlData: { id: row.groupActivityId } }).then((data) => {
159
+      console.log(data)
160
+      message.info('操作成功!')
161
+      getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() })
162
+    }).catch((err) => {
163
+      console.log(err)
164
+      message.info(err.msg || err.message)
165
+    })
180 166
   }
181 167
 
182 168
   //置顶
183 169
   const topGroupActivity = (row, weight) => () => {
184 170
     request({ ...apis.groupActivity.top, data: { groupActivityId: row.groupActivityId, weight: weight } }).then((data) => {
185
-        console.log(data)
186
-        message.info('操作成功!')
187
-        getList({ pageNum: 1, pageSize: 10 })
171
+      console.log(data)
172
+      message.info('操作成功!')
173
+      getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() })
188 174
     }).catch((err) => {
189
-        console.log(err)
190
-        message.info(err.msg || err.message)
175
+      console.log(err)
176
+      message.info(err.msg || err.message)
177
+    })
178
+  }
179
+
180
+  const sendOrPublicDynamic = row => {
181
+    if (row.status === 1) {
182
+      cancelDynamic(row)
183
+    } else {
184
+      sendDynamic(row)
185
+    }
186
+  }
187
+
188
+  // 取消活动
189
+  const cancelDynamic = row => {
190
+    request({ ...apis.groupActivity.cancel, urlData: { id: row.groupActivityId } }).then(data => {
191
+      message.info('操作成功!')
192
+      getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue()  })
193
+    }).catch(err => {
194
+      console.log(err)
195
+      message.info(err.msg || err.message)
196
+    })
197
+  }
198
+
199
+  // 发布活动
200
+  const sendDynamic = row => {
201
+    request({ ...apis.groupActivity.send, urlData: { id: row.groupActivityId } }).then(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)
191 207
     })
192 208
   }
193 209
 
194 210
   //首页推荐
195 211
   const recommendGroupActivity = (row, code) => () => {
196 212
     request({ ...apis.groupActivity.top, data: { groupActivityId: row.groupActivityId, sort: row.sort } }).then((data) => {
197
-        console.log(data)
198
-        message.info('操作成功!')
199
-        getList({ pageNum: 1, pageSize: 10 })
213
+      console.log(data)
214
+      message.info('操作成功!')
215
+      getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() })
200 216
     }).catch((err) => {
201
-        console.log(err)
202
-        message.info(err.msg || err.message)
217
+      console.log(err)
218
+      message.info(err.msg || err.message)
203 219
     })
204 220
   }
205
-    
206
-  //发布活动
207
-  const sendDynamic = (row) => {
208
-      request({ ...apis.activity.send, urlData: {id: row.dynamicId}}).then((data) => {
209
-          message.info('操作成功!')
210
-          getList({ pageNum: 1, pageSize: 10 });
211
-      }).catch(err => {
212
-          console.log(err)
213
-          message.info(err.msg || err.message)
214
-      })
215
-  }
216
-  
221
+
217 222
   const changePageNum = pageNumber => {
218
-      getList({ pageNum: pageNumber, pageSize: 10 })
223
+    getList({ pageNum: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
219 224
   }
220 225
 
221 226
   // 提交事件
222
-const handleSubmit = (e, props) => {
227
+  const handleSubmit = (e, props) => {
223 228
     e.preventDefault();
224 229
     props.form.validateFields((err, values) => {
225 230
       if (!err) {
@@ -229,9 +234,10 @@ const handleSubmit = (e, props) => {
229 234
     });
230 235
   }
231 236
 
232
-   //重置搜索
233
-   function handleReset() {
237
+  //重置搜索
238
+  function handleReset () {
234 239
     props.form.resetFields();
240
+    getList({ pageNum: 1, pageSize: 10 })
235 241
   }
236 242
 
237 243
 
@@ -272,14 +278,14 @@ const handleSubmit = (e, props) => {
272 278
             搜索
273 279
           </Button>
274 280
           <Button style={{ marginLeft: 8 }} onClick={handleReset}>
275
-              重置
281
+            重置
276 282
             </Button>
277 283
         </Form.Item>
278 284
       </Form>
279 285
       <AuthButton name="admin.taShareActivity.post" noRight={null}>
280 286
         <Button type="danger" className={styles.addBtn} onClick={toEditActivity()}>新增</Button>
281 287
       </AuthButton>
282
-      <Table dataSource={data.records} columns={columns} pagination={false} rowKey="activityList"/>
288
+      <Table style={{marginTop:'30px'}} dataSource={data.records} columns={columns} pagination={false} rowKey="activityList" />
283 289
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
284 290
         <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
285 291
       </div>

+ 33
- 8
src/pages/activity/helpActivity/edithelpActivity.jsx Прегледај датотеку

@@ -85,6 +85,11 @@ const header = props => {
85 85
           message.error('助力邀请人数不能超过200')
86 86
           return
87 87
         }
88
+          // 助力邀请人数>0
89
+        if (values.personNum <= 0) {
90
+          message.error('助力邀请人数大于0')
91
+          return
92
+        }
88 93
 
89 94
         // 判断助力人数必须大于0
90 95
         if (values.isEnlist === 1) {
@@ -92,10 +97,6 @@ const header = props => {
92 97
           message.error('限制助力次数必须大于0')
93 98
           return
94 99
         }
95
-        if (values.personNum <= 0) {
96
-          message.error('助力邀请人数大于0')
97
-          return
98
-        }
99 100
       }
100 101
         const { activityTime, signupTime, ...submitValue } = values
101 102
         const [startDate, endDate] = activityTime
@@ -153,12 +154,34 @@ const header = props => {
153 154
         })(<Input />)}
154 155
         </Form.Item>
155 156
 
156
-        <Form.Item label="活动主图" help="建议尺寸375*312px">
157
+        <Form.Item label="助力详情主图" help="建议图片尺寸:750*600px,比例5:4,格式:jpg,用于助力活动详情">
157 158
           {getFieldDecorator('img', {
158 159
           rules: [
159 160
             {
160 161
               required: true,
161
-              message: '活动主图不能为空',
162
+              message: '助力详情主图不能为空',
163
+            },
164
+          ],
165
+        })(<ImageUploader />)}
166
+        </Form.Item>
167
+
168
+        <Form.Item label="助力封面图1" help="建议图片尺寸:750*420px,比例16:9,格式:jpg,用于活动列表">
169
+          {getFieldDecorator('listImg', {
170
+          rules: [
171
+            {
172
+              required: true,
173
+              message: '助力封面图1不能为空',
174
+            },
175
+          ],
176
+        })(<ImageUploader />)}
177
+        </Form.Item>
178
+
179
+        <Form.Item label="助力封面图2" help="建议图片尺寸:670*224px,比例3:1,格式:jpg,用于首页底部活动轮播">
180
+          {getFieldDecorator('bannerListImg', {
181
+          rules: [
182
+            {
183
+              required: true,
184
+              message: '助力封面图2不能为空',
162 185
             },
163 186
           ],
164 187
         })(<ImageUploader />)}
@@ -373,9 +396,10 @@ const Edit = props => {
373 396
 
374 397
         <div >
375 398
           <div style={{ display: 'flex', width: '100%', margin: '60px 0' }}>
376
-            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报图</p>
399
+            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>助力海报图</p>
377 400
             <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
378 401
           </div>
402
+          <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于助力活动海报</p>
379 403
           <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
380 404
             <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
381 405
             <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
@@ -450,9 +474,10 @@ const Edit = props => {
450 474
         <Input placeholder="请输入分享标题" value={inputValue} onChange={e => changeInput(e.target.value)} />
451 475
       </div>
452 476
       <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
453
-        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享图</p>
477
+        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>助力分享图</p>
454 478
         <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
455 479
       </div>
480
+      <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于助力活动分享好友</p>
456 481
       <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
457 482
       <Button onClick={() => router.go(-1)}>取消</Button>
458 483
     </div>

+ 5
- 1
src/pages/activity/helpActivity/helpRecord.jsx Прегледај датотеку

@@ -32,7 +32,6 @@ class InviteTable extends React.Component {
32 32
 
33 33
   componentDidUpdate (preProps, preState) {
34 34
     const { helpId } = this.state.visibleData
35
-
36 35
     if (this.props.visibleData.visible !== preState.visibleData.visible) {
37 36
       this.getList({ helpRecordInitiateId: helpId, pageNumber: 1, pageSize: 5 })
38 37
       this.setState({ visibleData: this.props.visibleData });
@@ -42,15 +41,20 @@ class InviteTable extends React.Component {
42 41
   // 弹框确定按钮
43 42
   // eslint-disable-next-line react/sort-comp
44 43
   handleOk () {
44
+    this.setState({ visibleData: { visible: false, helpId: '', realtyConsultant: '' } })
45 45
     this.props.onCancel()
46 46
   }
47 47
 
48 48
   // 弹框取消按钮
49 49
   handleCancel () {
50
+    this.setState({ visibleData: { visible: false, helpId: '', realtyConsultant: '' } })
50 51
     this.props.onCancel()
51 52
   }
52 53
 
53 54
   getList (params) {
55
+    if (params.helpRecordInitiateId === '') {
56
+      return
57
+    }
54 58
     request({ ...apis.helpActivity.helpPeopleDetails, params: { ...params } }).then(res => {
55 59
       this.setState({ dataSource: res })
56 60
     }).catch(err => {

+ 27
- 37
src/pages/activity/helpActivity/list.jsx Прегледај датотеку

@@ -91,40 +91,30 @@ const toEditGoods = (helpActivityId) => () => {
91 91
       align: 'center',
92 92
       render: (x, row) => (
93 93
         <>
94
-          {row.activityStatus === 0 &&
94
+          {(row.activityStatus === 0 || row.activityStatus === 2) &&
95 95
           <AuthButton name="admin.helpRecord.get">
96
-             <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={ getSignList.bind(this, row.helpActivityId)}>助力记录<Icon type="snippets" className={styles.shoppingCart} /></span>
96
+             <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={ getSignList.bind(this, row.helpActivityId)}>助力记录<Icon type="snippets" style={{color:'#bebebe'}}   className={styles.shoppingCart} /></span>
97 97
           </AuthButton>}
98
+          {
99
+            <AuthButton name="admin.top.update.post" noRight={null}>
100
+              <span style={{ color: '#1990FF',marginRight: '20px', cursor: 'pointer' }} onClick={sendOrPublicDynamic.bind(this, row)}>{row.status === 1 ? '取消发布' : '发布'}<Icon type="close-circle" className={styles.edit} /></span>
101
+            </AuthButton>
102
+          }
98 103
           {row.activityStatus === 0 &&
104
+            <AuthButton name="admin.top.update.post" noRight={null}>
105
+            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 2)}>结束活动<Icon type="poweroff" style={{color:'#bebebe'}} className={styles.edit} /></span> </AuthButton>
106
+          }
107
+          {
99 108
           <AuthButton name="admin.top.update.post" noRight={null}>
100
-            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 2)}>结束活动<Icon type="poweroff" className={styles.edit} /></span>
101
-            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 0)}>{ row.weight === 1 ? '取消置顶' : '置顶' }<Icon type="vertical-align-top" className={styles.edit} /></span>
102
-            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 1)}>{ row.isMain === true ? '取消推首页' : '推首页' }<Icon type="vertical-align-top" className={styles.edit} /></span>
109
+            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 0)}>{ row.weight === 1 ? '取消标签' : '添加标签' }<Icon type="vertical-align-top"  style={{color:'#bebebe'}} className={styles.edit} /></span>
110
+            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 1)}>{ row.isMain === true ? '取消推首页' : '推首页' }<Icon type="vertical-align-top" style={{color:'#bebebe'}} className={styles.edit} /></span>
103 111
           </AuthButton> }
104 112
 
105
-          {row.activityStatus === 1 &&
113
+          {(row.activityStatus === 1 || row.activityStatus === 0) &&
106 114
           <AuthButton name="admin.helpActivity.update.put" noRight={null}>
107
-            <span style={{ color: '#FF925C', marginRight: '20px', cursor: 'pointer' }} onClick={toEditGoods(row.helpActivityId)}>编辑<Icon type="form" className={styles.edit} /></span>
108
-          </AuthButton>
109
-          }
110
-          {row.activityStatus === 1 &&
111
-           <AuthButton name="admin.top.update.post" noRight={null}>
112
-            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 0)}>{ row.weight === 1 ? '取消置顶' : '置顶' }<Icon type="vertical-align-top" className={styles.edit} /></span>
113
-            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 1)}>{ row.isMain === true ? '取消推首页' : '推首页' }<Icon type="vertical-align-top" className={styles.edit} /></span>
114
-            </AuthButton>
115
-          }
116
-
117
-          {row.activityStatus === 2 &&
118
-          <AuthButton name="admin.helpRecord.get" noRight={null}>
119
-            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={ getSignList.bind(this, row.helpActivityId)}>助力记录<Icon type="snippets" className={styles.shoppingCart} /></span>
115
+            <span style={{ color: '#FF925C', marginRight: '20px', cursor: 'pointer' }} onClick={toEditGoods(row.helpActivityId)}>编辑<Icon type="form" style={{color:'#bebebe'}} className={styles.edit} /></span>
120 116
           </AuthButton>
121 117
           }
122
-           {row.activityStatus === 2 &&
123
-        <AuthButton name="admin.top.update.post" noRight={null}>
124
-           <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 0)}>{ row.weight === 1 ? '取消置顶' : '置顶' }<Icon type="vertical-align-top" className={styles.edit} /></span>
125
-            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 1)}>{ row.isMain === true ? '取消推首页' : '推首页' }<Icon type="vertical-align-top" className={styles.edit} /></span>
126
-        </AuthButton>
127
-          }
128 118
         </>
129 119
       ),
130 120
     },
@@ -147,7 +137,7 @@ const toEditGoods = (helpActivityId) => () => {
147 137
               request({ ...apis.activity.finish, data: {dynamicId: row.dynamicId, top: ""} }).then((data) => {
148 138
                   console.log(data)
149 139
                   message.info('操作成功!')
150
-                  getList({ pageNum: 1, pageSize: 10 })
140
+                  getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() })
151 141
               }).catch((err) => {
152 142
                   console.log(err)
153 143
                   message.info(err.msg || err.message)
@@ -161,26 +151,26 @@ const toEditGoods = (helpActivityId) => () => {
161 151
       request({ ...apis.helpActivity.top, data: { helpActivityId: row.helpActivityId, status: code } }).then((data) => {
162 152
           console.log(data)
163 153
           message.info('操作成功!')
164
-          getList({ pageNum: 1, pageSize: 10 })
154
+          getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() })
165 155
       }).catch((err) => {
166 156
           console.log(err)
167 157
           message.info(err.msg || err.message)
168 158
       })
169 159
   }
170 160
   
171
-  // const sendOrPublicDynamic = (row) => {
172
-  //     if (row.status === 1) {
173
-  //         cancelDynamic(row)
174
-  //     } else {
175
-  //         sendDynamic(row)
176
-  //     }
177
-  // }
161
+  const sendOrPublicDynamic = (row) => {
162
+      if (row.status === 1) {
163
+          cancelDynamic(row)
164
+      } else {
165
+          sendDynamic(row)
166
+      }
167
+  }
178 168
   
179 169
   // 取消活动
180 170
   const cancelDynamic = (row) => {
181 171
       request({ ...apis.activity.cancel, urlData: {id: row.dynamicId}}).then((data) => {
182 172
           message.info('操作成功!')
183
-          getList({ pageNum: 1, pageSize: 10 })
173
+          getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() })
184 174
       }).catch((err) => {
185 175
           console.log(err)
186 176
           message.info(err.msg || err.message)
@@ -191,7 +181,7 @@ const toEditGoods = (helpActivityId) => () => {
191 181
   const sendDynamic = (row) => {
192 182
       request({ ...apis.activity.send, urlData: {id: row.dynamicId}}).then((data) => {
193 183
           message.info('操作成功!')
194
-          getList({ pageNum: 1, pageSize: 10 });
184
+          getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() });
195 185
       }).catch(err => {
196 186
           console.log(err)
197 187
           message.info(err.msg || err.message)
@@ -199,7 +189,7 @@ const toEditGoods = (helpActivityId) => () => {
199 189
   }
200 190
   
201 191
   const changePageNum = pageNumber => {
202
-      getList({ pageNum: pageNumber, pageSize: 10 })
192
+      getList({ pageNum: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
203 193
   }
204 194
 
205 195
   // 提交事件

+ 28
- 9
src/pages/building/list/add/components/amap.jsx Прегледај датотеку

@@ -4,23 +4,29 @@ import { Map, Marker } from 'react-amap';
4 4
 import styles from '../amap.less'
5 5
 
6 6
 class Amap extends React.Component {
7
+
7 8
   constructor(props) {
8 9
     super(props);
10
+    this.state = {
11
+      markerPosition: { longitude: 120, latitude: 35 },
12
+    }
9 13
     // 高德地图 Marker 实例
10 14
     this.markerInstance = undefined
11 15
     // 高德地图 Map 实例
12 16
     this.mapInstance = undefined
17
+
13 18
     this.amapEvents = {
14 19
       created: mapInstance => {
15 20
         console.log('高德地图 Map 实例创建成功;如果你要亲自对实例进行操作,可以从这里开始。比如:');
16
-        console.log(mapInstance.getZoom());
21
+        console.log('缩放级别:', mapInstance.getZoom());
17 22
         this.mapInstance = mapInstance
23
+        
18 24
 
19 25
         AMap.plugin(['AMap.Autocomplete', 'AMap.PlaceSearch', 'AMap.CitySearch'], () => {
20 26
           // 实例化Autocomplete
21 27
           const autoOptions = {
22 28
             // city 限定城市,默认全国
23
-            city: '全国',
29
+            // city: '025',
24 30
             // input 为绑定输入提示功能的input的DOM ID
25 31
             input: 'amapInput',
26 32
           }
@@ -28,7 +34,7 @@ class Amap extends React.Component {
28 34
           // 无需再手动执行search方法,autoComplete会根据传入input对应的DOM动态触发search
29 35
 
30 36
           const placeSearch = new AMap.PlaceSearch({
31
-            city: '南京',
37
+            // city: '南京',
32 38
             map: mapInstance,
33 39
           })
34 40
 
@@ -54,6 +60,8 @@ class Amap extends React.Component {
54 60
                 // document.getElementById('info').innerHTML = '您当前所在城市:'+cityinfo;
55 61
                 // 地图显示当前城市
56 62
                 mapInstance.setBounds(citybounds);
63
+                // 需要在设置坐标成功后,重新设置 缩放级别
64
+                // mapInstance.setZoom(15)
57 65
               }
58 66
             }
59 67
           })
@@ -75,20 +83,31 @@ class Amap extends React.Component {
75 83
         this.markerInstance = markerInstance
76 84
       },
77 85
     }
78
-    this.markerPosition = { longitude: 120, latitude: 30 };
86
+    // this.markerPosition = { longitude: 120, latitude: 30 };
79 87
   }
80 88
 
81
-  render() {
89
+  componentDidUpdate(prevProps) {
82 90
     const { value } = this.props
83
-    if (value) {
84
-     // this.markerInstance.setPosition(value.split(','))
91
+    if (this.props.value !== prevProps.value) {
92
+      if (value) {
93
+        const temp = value.split(',')
94
+        this.setState({ markerPosition: { longitude: temp[1], latitude: temp[0] } }, () => {
95
+          if (this.mapInstance) {
96
+            // 需要在设置坐标成功后,重新设置 缩放级别
97
+            this.mapInstance.setZoom(15)
98
+          }
99
+        })
100
+      }
85 101
     }
102
+  }
86 103
 
104
+  render() {
87 105
     return (
88 106
       <>
89 107
         <div style={{ width: '100%', height: '400px', position: 'relative' }}>
90
-          <Map events={this.amapEvents} amapkey="f0d1d4f82432504003ebf46e5e36ff03">
91
-            <Marker position={this.markerPosition} events={this.markerEvents} />
108
+          {/* zoom={15} 设置后,无效,不知道什么原因,必须手动设置 */}
109
+          <Map plugins={['ToolBar']} events={this.amapEvents} amapkey="f0d1d4f82432504003ebf46e5e36ff03" center={this.state.markerPosition}>
110
+            <Marker position={this.state.markerPosition} events={this.markerEvents} />
92 111
           </Map>
93 112
           {
94 113
           <div className={styles.infoBox}>

+ 103
- 0
src/pages/building/list/add/components/amapAroundData.js Прегледај датотеку

@@ -0,0 +1,103 @@
1
+import request from '../../../../../utils/request';
2
+import apis from '../../../../../services/apis';
3
+
4
+const KEY = '14f05ce59c26364fd0674014dc0d8b1b'
5
+
6
+const POI_TYPES_KETY = {
7
+    Transport: 'Transport',
8
+    Mall: 'Mall',
9
+    Edu: 'Edu',
10
+    Hospital: 'Hospital',
11
+    Bank: 'Bank',
12
+    Restaurant: 'Restaurant',
13
+}
14
+
15
+// key 值会被拿到 building 表中 组合为字段名
16
+const POI_TYPES = [
17
+    {
18
+      key: POI_TYPES_KETY.Transport,
19
+      label: '交通',
20
+      types: ['150100', '150200', '150300', '150400', '150500', '150600'],
21
+      data: [],
22
+    },
23
+    {
24
+      key: POI_TYPES_KETY.Mall,
25
+      label: '商业',
26
+      types: ['060100', '060200', '060300', '060400', '060500', '060600',
27
+              '060700', '060800', '060900', '061000', '061100', '061200',
28
+              '061300', '061400', '080100', '080200', '080300', '080400',
29
+              '080500', '080600'],
30
+      data: [],
31
+    },
32
+    {
33
+      key: POI_TYPES_KETY.Edu,
34
+      label: '学校',
35
+      types: ['141200'],
36
+      data: [],
37
+    },
38
+    {
39
+      key: POI_TYPES_KETY.Hospital,
40
+      label: '医院',
41
+      types: ['090100', '090200', '090300', '090400', '090500', '090600', '090700'],
42
+      data: [],
43
+    },
44
+    {
45
+      key: POI_TYPES_KETY.Bank,
46
+      label: '银行',
47
+      types: ['160100'],
48
+      data: [],
49
+    },
50
+    {
51
+      key: POI_TYPES_KETY.Restaurant,
52
+      label: '餐饮',
53
+      types: ['050100', '050200', '050300', '050400', '050500', '050600',
54
+              '050700', '050800', '050900'],
55
+      data: [],
56
+    },
57
+  ]
58
+
59
+/**
60
+ * 获取 POI 类型
61
+ * @param {*} keyType 
62
+ */
63
+const getPOIType = keyType => {
64
+    return POI_TYPES.filter(item => item.key === keyType)
65
+}
66
+
67
+/**
68
+ * 获取这个 keyType 类型的所有 types
69
+ * @param {类型的key值} keyType 
70
+ */
71
+const getTypes = keyType => {
72
+  const typesArr = getPOIType(keyType)
73
+  return typesArr[0].types.join('|')
74
+}
75
+
76
+/**
77
+ * 获取周边数据
78
+ * @param {查询参数} params 
79
+ */
80
+function getAroundData (params) {
81
+    return new Promise((resolve, reject) => {
82
+        const { types, location } = params
83
+        if (!types) {
84
+            // console.err('未传输类型types值')
85
+            reject(new Error('未传输类型types值'))
86
+            return
87
+        }
88
+        if (!location) {
89
+            // console.err('未传输传输中心坐标location值')
90
+            reject(new Error('未传输传输中心坐标location值'))
91
+            return
92
+        }
93
+
94
+        request({ ...apis.amap.webService, params: { ...params, key: KEY, types: getTypes(types), location } }).then(data => {
95
+            // console.log(data)
96
+            resolve(data)
97
+        }).catch(err => {
98
+            reject(err)
99
+        })
100
+    })
101
+}
102
+
103
+export { POI_TYPES_KETY, getAroundData, getPOIType, POI_TYPES }

+ 191
- 24
src/pages/building/list/add/components/base.jsx Прегледај датотеку

@@ -1,10 +1,10 @@
1 1
 import React, { useState, useEffect } from 'react';
2 2
 import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Radio, Tag, Tooltip, Tabs, InputNumber, notification } from 'antd';
3 3
 import moment from 'moment';
4
+import { router } from 'umi';
4 5
 import request from '../../../../../utils/request';
5 6
 import apis from '../../../../../services/apis';
6 7
 import Styles from '../style.less';
7
-import { router } from 'umi';
8 8
 import ImageUpload from '../../../../../components/XForm/ImageUpload'
9 9
 import ImageListUpload from '../../../../../components/XForm/ImageListUpload'
10 10
 import Wangedit from '../../../../../components/Wangedit/Wangedit'
@@ -12,6 +12,9 @@ import TagGroup from './tags'
12 12
 import Amap from './amap'
13 13
 import BudildingProjectType from './buildingProjectType'
14 14
 import SelectCity from '../../../../../components/SelectButton/CitySelect'
15
+import FileUpload from '@/components/XForm/FileUpload';
16
+import { POI_TYPES_KETY, getAroundData, getPOIType, POI_TYPES } from './amapAroundData'
17
+import { ifError } from 'assert';
15 18
 
16 19
 const { Option } = Select
17 20
 const { TabPane } = Tabs;
@@ -40,19 +43,25 @@ function openNotificationWithIcon(type, message) {
40 43
 function AddBuilding(props) {
41 44
   const { getFieldDecorator } = props.form;
42 45
 
46
+  const [poi, setPoi] = useState([])
47
+
48
+  // 视频上传按钮是否 禁用
49
+  const [fileUploadDisabled, setFileUploadDisabled] = useState(false)
50
+
51
+  // console.log('props.building: ', props.building)
43 52
   if (props.building.buildingId !== undefined) {
44 53
     const { buildingId } = props.building
45
-    if (buildingId !== '') {
46
-      // eslint-disable-next-line react-hooks/rules-of-hooks
47
-      useEffect(() => {
54
+     // eslint-disable-next-line react-hooks/rules-of-hooks
55
+     useEffect(() => {
56
+      if (buildingId !== '') {
48 57
         getById(buildingId)
49
-      }, [])
50
-    }
58
+        setPoi(POI_TYPES)
59
+      }
60
+    }, [])
51 61
   }
52 62
 
53 63
    // 获取详情信息
54 64
    function getById(currentId) {
55
-
56 65
     request({ ...apis.building.buildingGetById, urlData: { id: currentId } }).then(res => {
57 66
       if (res.openingDate !== null) {
58 67
         res.openingDate = moment(res.openingDate)
@@ -65,7 +74,19 @@ function AddBuilding(props) {
65 74
       }
66 75
 
67 76
       res.avatarImage = res.buildingImg.map(item => item.url)
77
+      res.listImage = res.buildingListImg.map(item => item.url)
78
+      res.mapCoordinate = res.coordinate
79
+      if (res.videoUrl) {
80
+        res.videoUrl = [].concat(res.videoUrl)
81
+        // 视频上传按钮禁用
82
+        setFileUploadDisabled(true)
83
+      }
84
+      if (res.videoImage) {
85
+        res.videoImage = res.videoImage[0].url
86
+      }
87
+      setPoi(res.mapJson || [])
68 88
       props.form.setFieldsValue(res)
89
+      props.onSuccess(res)
69 90
     })
70 91
   }
71 92
 
@@ -79,26 +100,126 @@ function AddBuilding(props) {
79 100
   }
80 101
 
81 102
   function addBuilding(data) {
103
+    // console.log('poi: ', poi)
104
+    data.mapJson = poi
82 105
     data.openingDate = moment(data.openingDate, 'yyyy-MM-dd HH:mm:ss')
83 106
     data.receivedDate = moment(data.receivedDate, 'yyyy-MM-dd HH:mm:ss')
84 107
     // 项目主图
85 108
     data.img = data.avatarImage && data.avatarImage.map((item, index) => ({ imgType: 'banner', url: item, orderNo: index + 1 }))
109
+    // 列表图
110
+    data.listImg = data.listImage && data.listImage.map((item, index) => ({ imgType: 'list', url: item, orderNo: index + 1 }))
111
+    if (data.videoUrl) {
112
+      // console.log(data.videoUrl[0])
113
+      data.videoUrl = data.videoUrl[0]
114
+    }
115
+    
86 116
     if (data.tag) {
87 117
       data.tag = data.tag.map((item, _) => ({ tagName: item }))
88 118
     }
89 119
 
120
+    if (data.videoImage) {
121
+      data.videoImage = [{ imgType: 'videoImage', url: data.videoImage, orderNo: 1 }]
122
+    }
123
+
90 124
     const api = data.buildingId === undefined ? apis.building.addBuilding : apis.building.updateBuilding
91
-    request({ ...api, data: { ...data } }).then(() => {
125
+    request({ ...api, data: { ...data } }).then(res => {
92 126
       openNotificationWithIcon('success', '操作成功')
93
-      router.go(-1)
127
+      // router.go(-1)
128
+      getById(res.buildingId)
94 129
     }).catch(err => {
95 130
       openNotificationWithIcon('error', err.message)
96 131
     })
97 132
   }
98 133
 
134
+  // 视频文件上传前 回调
135
+  function fileUploadBeforeUpload(file, fileList) {
136
+    // console.log('视频文件上传前 回调: ', file, fileList)
137
+    return new Promise((resolve, reject) => {
138
+      if (fileUploadDisabled) {
139
+        openNotificationWithIcon('error', '项目视频,只允许上传一个')
140
+        reject()
141
+      } else if (file.type === 'video/mp4' || file.type === '.mp4') {
142
+          setFileUploadDisabled(true)
143
+          resolve(file)
144
+      } else {
145
+        openNotificationWithIcon('error', '项目视频,仅支持MP4格式')
146
+        reject()
147
+      }
148
+    })
149
+  }
150
+
151
+  // 周边设施 回调
152
+  function getMapScope(e) {
153
+    const coordinate = props.form.getFieldValue('coordinate').split(',')
154
+    const poiData = [].concat(POI_TYPES)
155
+    poiData.map(item => {
156
+      getAroundData({ types: item.key, location: `${coordinate[1]},${coordinate[0]}`, radius: e }).then(res => {
157
+        const { pois } = res
158
+        setFormMapScopeValue(item.key, pois)
159
+      }).catch(err => {
160
+        console.log(err.message)
161
+        openNotificationWithIcon('error', '周边数据获取失败')
162
+      })
163
+    })
164
+  }
165
+
166
+  function setFormMapScopeValue(key, pois) {
167
+    const poiArray = pois.map(p => {
168
+      return {
169
+        address: p.address,
170
+        adname: p.adname,
171
+        cityname: p.cityname,
172
+        distance: p.distance,
173
+        id: p.id,
174
+        location: p.location,
175
+        name: p.name,
176
+        pname: p.pname,
177
+        shopinfo: p.shopinfo,
178
+        type: p.type,
179
+        typecode: p.typecode,
180
+      }
181
+    })
182
+    
183
+    // 设置表单值
184
+    getFormMapScopeName(key, { data: poiArray })
185
+
186
+    const poiData = [].concat(POI_TYPES)
187
+    const newPoi = poiData.map(m => {
188
+      if (m.key === key) {
189
+        m.data = poiArray
190
+      }
191
+      return m
192
+    })
193
+    setPoi(newPoi)
194
+  }
195
+
196
+  function getFormMapScopeName(keyType, item) {
197
+    switch (keyType) {
198
+      case POI_TYPES_KETY.Transport:
199
+        props.form.setFieldsValue({ buildingTransport: item.data.map(t => t.name).join(',') })
200
+        return 'buildingTransport';
201
+      case POI_TYPES_KETY.Bank:
202
+        props.form.setFieldsValue({ buildingBank: item.data.map(t => t.name).join(',') })
203
+        return 'buildingBank';
204
+      case POI_TYPES_KETY.Edu:
205
+        props.form.setFieldsValue({ buildingEdu: item.data.map(t => t.name).join(',') })
206
+        return 'buildingEdu';
207
+      case POI_TYPES_KETY.Hospital:
208
+        props.form.setFieldsValue({ buildingHospital: item.data.map(t => t.name).join(',') })
209
+        return 'buildingHospital';
210
+      case POI_TYPES_KETY.Restaurant:
211
+        props.form.setFieldsValue({ buildingRestaurant: item.data.map(t => t.name).join(',') })
212
+        return 'buildingRestaurant';
213
+      case POI_TYPES_KETY.Mall:
214
+        props.form.setFieldsValue({ buildingMall: item.data.map(t => t.name).join(',') })
215
+        return 'buildingMall';
216
+      default:
217
+    }
218
+  }
219
+
99 220
   return (
100 221
         <Form {...formItemLayout} onSubmit={handleSubmit}>
101
-          <Form.Item label="项目Id"  style={{ display: 'none' }}>
222
+          <Form.Item label="项目Id" style={{ display: 'none' }}>
102 223
             {getFieldDecorator('buildingId')(<Input disabled />)}
103 224
           </Form.Item>
104 225
           <Form.Item label="楼盘编号" >
@@ -111,11 +232,13 @@ function AddBuilding(props) {
111 232
               rules: [{ required: true, message: '请输入楼盘名' }],
112 233
             })(<Input />)}
113 234
           </Form.Item>
114
-          <Form.Item label="别名" >
235
+          {/* <Form.Item label="别名" >
115 236
             {getFieldDecorator('name')(<Input />)}
116
-          </Form.Item>
237
+          </Form.Item> */}
117 238
           <Form.Item label="项目类型">
118
-            {getFieldDecorator('buildingProjectType')(<BudildingProjectType />)}
239
+            {getFieldDecorator('buildingProjectType', {
240
+              rules: [{ required: true, message: '请选择项目类型' }],
241
+            })(<BudildingProjectType />)}
119 242
           </Form.Item>
120 243
           <Form.Item label="均价" >
121 244
             {getFieldDecorator('price')(<Input type="number" style={{ width: '210px' }}/>)}元/m²
@@ -146,7 +269,9 @@ function AddBuilding(props) {
146 269
             )}
147 270
           </Form.Item>
148 271
           <Form.Item label="销售状态" >
149
-            {getFieldDecorator('marketStatus')(
272
+            {getFieldDecorator('marketStatus', {
273
+              rules: [{ required: true, message: '请选择销售状态' }],
274
+            })(
150 275
               <Select placeholder="销售状态" style={{ width: '1016px' }}>
151 276
                 <Option value="待定">待定</Option>
152 277
                 <Option value="在售">在售</Option>
@@ -157,20 +282,42 @@ function AddBuilding(props) {
157 282
           <Form.Item label="项目标签" >
158 283
             {getFieldDecorator('tag')(
159 284
               <Select mode="tags" placeholder="输入后选中" style={{ width: '1016px' }}>
160
-                
285
+
161 286
               </Select>,
162 287
             )}
163 288
           </Form.Item>
164
-          <Form.Item label="项目主图" help="建议图片尺寸:640px*360px">
165
-            {getFieldDecorator('avatarImage')(
289
+          <Form.Item label="项目视频" help="视频仅支持mp4格式,建议尺寸:1920*1080,比例16:9">
290
+            {getFieldDecorator('videoUrl')(
291
+              // disabled={fileUploadDisabled}
292
+              <FileUpload accept=".mp4" beforeUpload={fileUploadBeforeUpload} label="上传视频" />,
293
+            )}
294
+          </Form.Item>
295
+          <Form.Item label="视频封面图" help="建议图片尺寸:750*600px,比例5:4,格式:jpg,用于视频封面" >
296
+            {getFieldDecorator('videoImage', {
297
+              rules: [{ required: true, message: '请选择视频封面图' }],
298
+            })(
299
+              <ImageUpload />,
300
+            )}
301
+          </Form.Item>
302
+          <Form.Item label="楼盘主图" help="建议图片尺寸:750*600px,比例5:4,格式:jpg,用于楼盘详情">
303
+            {getFieldDecorator('avatarImage', {
304
+              rules: [{ required: true, message: '请选择项目主图' }],
305
+            })(
306
+              <ImageListUpload />,
307
+            )}
308
+          </Form.Item>
309
+          <Form.Item label="楼盘封面图" help="建议图片尺寸:670*377px,比例16:9,格式:jpg,用于楼盘列表">
310
+            {getFieldDecorator('listImage', {
311
+              rules: [{ required: true, message: '请选择列表图' }],
312
+            })(
166 313
               <ImageListUpload />,
167 314
             )}
168 315
           </Form.Item>
169
-          <Form.Item label="地址图片" help="建议图片尺寸:750px*455px">
316
+          {/* <Form.Item label="地址图片" help="建议图片尺寸:750px*455px">
170 317
             {getFieldDecorator('mapImg')(
171 318
               <ImageUpload />,
172 319
             )}
173
-          </Form.Item>
320
+          </Form.Item> */}
174 321
           {/* <Form.Item label="海报底图" help="建议图片尺寸:640px*1136px" >
175 322
             {getFieldDecorator('poster')(
176 323
               <ImageUpload />,
@@ -183,7 +330,9 @@ function AddBuilding(props) {
183 330
             {getFieldDecorator('discount')(<Input />)}
184 331
           </Form.Item>
185 332
           <Form.Item label="首页推荐" >
186
-            {getFieldDecorator('isMain')(
333
+            {getFieldDecorator('isMain', {
334
+              initialValue: 1,
335
+            })(
187 336
             <Radio.Group>
188 337
               <Radio value={1}>是</Radio>
189 338
               <Radio value={2}>否</Radio>
@@ -198,16 +347,34 @@ function AddBuilding(props) {
198 347
             )}
199 348
           </Form.Item>
200 349
           <Form.Item label="楼盘区域" >
201
-            {getFieldDecorator('buildingArea')(<Input />)}
350
+            {getFieldDecorator('buildingArea', {
351
+              rules: [{ required: true, message: '请输入楼盘区域' }],
352
+            })(<Input />)}
202 353
           </Form.Item>
203 354
           <Form.Item label="项目地址" >
204
-            {getFieldDecorator('address')(<Input />)}
355
+            {getFieldDecorator('address', {
356
+              rules: [{ required: true, message: '请输入项目地址' }],
357
+            })(<Input />)}
205 358
           </Form.Item>
206 359
           <Form.Item label="项目坐标" >
207
-            {getFieldDecorator('coordinate')(<Input disabled />)}
360
+            {getFieldDecorator('coordinate', {
361
+              rules: [{ required: true, message: '请输入项目坐标' }],
362
+            })(<Input disabled />)}
208 363
           </Form.Item>
209 364
           <Form.Item label="地图位置" >
210
-            {getFieldDecorator('coordinate')(<Amap />)}
365
+            {getFieldDecorator('mapCoordinate')(<Amap onChange={e => props.form.setFieldsValue({ coordinate: e })}/>)}
366
+          </Form.Item>
367
+          <Form.Item label="周边设施搜索范围" style={{ width: '2000px' }}>
368
+            {getFieldDecorator('mapScope', {
369
+              rules: [{ required: true, message: '请选择周边设施搜索范围' }],
370
+            })(
371
+              <Select placeholder="请选择周边设施搜索范围" style={{ width: '970px' }} onChange={e => getMapScope(e)}>
372
+                <Option value={1000}>1公里</Option>
373
+                <Option value={3000}>3公里</Option>
374
+                <Option value={5000}>5公里</Option>
375
+                <Option value={10000}>10公里</Option>
376
+              </Select>,
377
+            )}
211 378
           </Form.Item>
212 379
           <Form.Item label="周边交通" >
213 380
             {getFieldDecorator('buildingTransport')(

+ 275
- 0
src/pages/building/list/add/components/buildingImage.jsx Прегледај датотеку

@@ -0,0 +1,275 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Radio, Tag, Tooltip, Tabs, Table, notification, Modal, Layout } from 'antd';
3
+import ImageListUpload from '../../../../../components/XForm/ImageListUpload';
4
+import moment from 'moment';
5
+import request from '../../../../../utils/request';
6
+import apis from '../../../../../services/apis';
7
+
8
+const { Header, Footer, Sider, Content } = Layout;
9
+
10
+const modalEdiFormItemLayout = {
11
+  labelCol: {
12
+    xs: { span: 24 },
13
+    sm: { span: 8 },
14
+  },
15
+  wrapperCol: {
16
+    xs: { span: 24 },
17
+    sm: { span: 16 },
18
+  },
19
+};
20
+
21
+const openNotificationWithIcon = (type, message) => {
22
+  notification[type]({
23
+    message,
24
+    description:
25
+      '',
26
+  });
27
+};
28
+
29
+/**
30
+ * 弹框
31
+ */
32
+function ModalEdi(props) {
33
+  const { apartment, buildingId, apartmentId } = props.visibleData
34
+  const [visibleData, setVisibleData] = useState({ visible: false, buildingId: '', apartmentId: '', apartment: '' })
35
+
36
+  if (!props.visibleData) {
37
+    console.error('缺少visibleData参数!')
38
+  }
39
+
40
+  useEffect(() => {
41
+    setVisibleData(props.visibleData)
42
+    props.form.setFieldsValue({ apartmentId, apartmentName: apartment !== '' ? apartment.apartmentName : '' })
43
+  }, [props.visibleData.visible])
44
+
45
+  function handleOk(e) {
46
+    // console.log(e);
47
+    props.onCancel();
48
+  }
49
+
50
+  function handleCancel(e) {
51
+    // console.log(e);
52
+    props.onCancel();
53
+  }
54
+
55
+  function handleSubmit(e) {
56
+    e.preventDefault();
57
+    props.form.validateFieldsAndScroll((err, values) => {
58
+      if (!err) {
59
+        console.log('Received values of form: ', values);
60
+        submitData(values)
61
+      }
62
+    });
63
+  }
64
+
65
+  function submitData(data) {
66
+    if (buildingId === '' || buildingId === undefined) {
67
+      return
68
+    }
69
+    if (data.img) {
70
+        // 如果是 名称 和 图片一起编辑,就穿最新的图片
71
+      data.img = data.img.map((item, index) => ({ imgType: 'aparment', url: item, orderNo: index }))
72
+    } else {
73
+        // 如果是 名称 和 图片一起编辑,就穿最新的图片
74
+      data.img = visibleData.apartment.buildingImgList
75
+    }
76
+    data.buildingId = buildingId;
77
+    data.apartmentType = 'photo'
78
+    const api = (data.apartmentId !== undefined && data.apartmentId !== '') ? apis.building.buildingApartmentUpdate : apis.building.buildingApartmentAdd;
79
+
80
+    // 网路请求
81
+    request({ ...api, data: { ...data } }).then(() => {
82
+      // eslint-disable-next-line no-unused-expressions
83
+      openNotificationWithIcon('success', '操作成功')
84
+      handleCancel()
85
+      props.onSuccess()
86
+      // this.setState({ visibleData: { visible: false, apartmentId: '', buildingId: '' } }, () => console.log('回调:', this.state.visibleData))
87
+    }).catch(err => {
88
+      // eslint-disable-next-line no-unused-expressions
89
+      openNotificationWithIcon('error', err)
90
+    })
91
+  }
92
+
93
+  const { getFieldDecorator } = props.form;
94
+  return (
95
+    <>
96
+      <Modal
97
+          title="编辑"
98
+          visible={visibleData.visible}
99
+          onOk={handleOk}
100
+          onCancel={handleCancel}
101
+          width={700}
102
+          footer={null}
103
+        >
104
+         <Form {...modalEdiFormItemLayout} onSubmit={handleSubmit}>
105
+          <Form.Item label="编号" style={{ display: 'none' }}>
106
+              {getFieldDecorator('apartmentId')(<Input />)}
107
+          </Form.Item>
108
+          <Form.Item label="相册名称">
109
+            {getFieldDecorator('apartmentName', {
110
+              rules: [
111
+                {
112
+                  required: true,
113
+                  message: '请输入相册名称',
114
+                },
115
+                {
116
+                  max: 10,
117
+                  message: '不超过10个字符',
118
+                },
119
+              ],
120
+            })(<Input />)}
121
+          </Form.Item>
122
+          {
123
+            !props.noImage && <Form.Item label="选择图片">
124
+            {getFieldDecorator('img', {
125
+              rules: [
126
+                {
127
+                  required: true,
128
+                  message: '请选择图片',
129
+                },
130
+              ],
131
+            })(<ImageListUpload />)}
132
+          </Form.Item>
133
+          }
134
+          <Form.Item style={{ display: 'flex', justifyContent: 'flex-end' }}>
135
+            <Button type="primary" htmlType="submit">
136
+              保存
137
+            </Button>
138
+            &nbsp;&nbsp;&nbsp;&nbsp;
139
+            <Button onClick={() => handleCancel()}>
140
+              取消
141
+            </Button>
142
+          </Form.Item>
143
+         </Form>
144
+        </Modal>
145
+    </>
146
+  )
147
+}
148
+
149
+const WrappedModalEdiForm = Form.create({ name: 'ModalEdi' })(ModalEdi);
150
+
151
+/**
152
+ * 模块
153
+ */
154
+function BuildingImageModel(props) {
155
+  const [imageList, setImageList] = useState([])
156
+  const [visibleData, setVisibleData] = useState({ visible: false, buildingId: '', apartmentId: '', apartment: '' })
157
+
158
+  useEffect(() => {
159
+    setImageList(getImgUrl())
160
+  }, [props.apartment.apartmentId])
161
+
162
+  function getImgUrl() {
163
+    return ((props.apartment.buildingImgList || [])).map(item => item.url)
164
+  }
165
+
166
+  function submitData(data) {
167
+    const { apartmentId } = props.apartment
168
+    if (apartmentId === '' || apartmentId === undefined) {
169
+      return
170
+    }
171
+
172
+    data.buildingId = props.apartment.buildingId;
173
+    data.apartmentType = 'photo'
174
+    const api = data.apartmentId !== undefined ? apis.building.buildingApartmentUpdate : apis.building.buildingApartmentAdd;
175
+
176
+    // 网路请求
177
+    request({ ...api, data: { ...data } }).then(() => {
178
+      // eslint-disable-next-line no-unused-expressions
179
+      openNotificationWithIcon('success', '操作成功')
180
+    }).catch(err => {
181
+      // eslint-disable-next-line no-unused-expressions
182
+      // openNotificationWithIcon('error', err)
183
+    })
184
+  }
185
+
186
+  function onImageChange(e) {
187
+    setImageList(e)
188
+       
189
+    // 新增加图片后,更新后端数据
190
+    const img = e.map((item, index) => ({ imgType: 'aparment', url: item, orderNo: index }))
191
+    submitData({ ...props.apartment, img })
192
+  }
193
+
194
+  function edi() {
195
+    setVisibleData({ visible: true, buildingId: props.apartment.buildingId, apartmentId: props.apartment.apartmentId, apartment: props.apartment })
196
+  }
197
+
198
+  function onCancel(e) {
199
+    setVisibleData({ visible: false, buildingId: '', apartmentId: '', apartment: '' })
200
+  }
201
+
202
+  function deletePhoto() {
203
+    request({ ...apis.building.buildingApartmentDelete, urlData: { id: props.apartment.apartmentId } }).then(() => {
204
+      openNotificationWithIcon('success', '操作成功')
205
+      props.onSuccess()
206
+    }).catch(err => {
207
+
208
+    })
209
+  }
210
+
211
+  return (
212
+    <>
213
+      <span style={{ marginTop: '10px', marginBottom: '10px' }}>{props.apartment.apartmentName}({imageList.length})</span>
214
+      <Button type="link" style={{ color: 'blue' }} onClick={() => edi()}>重命名</Button>
215
+      <Button type="link" style={{ color: 'blue' }} onClick={() => deletePhoto()}>删除相册</Button>
216
+      <ImageListUpload value={imageList} onChange={onImageChange} unlimited/>
217
+
218
+       {/* 编辑页 */}
219
+       <WrappedModalEdiForm visibleData={visibleData} onCancel={e => onCancel(e)} onSuccess={() => props.onSuccess()} noImage/>
220
+       <hr />
221
+    </>
222
+  )
223
+}
224
+
225
+/**
226
+ * 主体
227
+ */
228
+function buildingImage(props) {
229
+  // eslint-disable-next-line react-hooks/rules-of-hooks
230
+  const [visibleData, setVisibleData] = useState({ visible: false, buildingId: '', apartmentId: '', apartment: '' })
231
+  const [imageList, setImageList] = useState([])
232
+
233
+  // eslint-disable-next-line react-hooks/rules-of-hooks
234
+  useEffect(() => {
235
+    getList()
236
+  }, [props.building.buildingId])
237
+ 
238
+
239
+  function edi() {
240
+    setVisibleData({ visible: true, buildingId: props.building.buildingId, apartmentId: '', apartment: '' })
241
+  }
242
+
243
+  function onCancel(e) {
244
+    setVisibleData({ visible: false, buildingId: '', apartmentId: '', apartment: '' })
245
+  }
246
+
247
+  function onSuccess(e) {
248
+    getList()
249
+  }
250
+
251
+  function getList(params) {
252
+    // 网路请求
253
+    request({ ...apis.building.buildingApartment, urlData: { id: props.building.buildingId }, params: { ...params, apartmentType: 'photo' } }).then(res => {
254
+      setImageList(res)
255
+    }).catch(err => {
256
+      openNotificationWithIcon('error', err.message)
257
+    })
258
+  }
259
+
260
+  return (
261
+    <>
262
+      <Button type="primary" onClick={() => edi()}>新增</Button>
263
+      <Layout style={{ background: '#fff' }}>
264
+        {
265
+          imageList.map(item => <Content><BuildingImageModel apartment={item} key={item.apartmentId} onSuccess={e => onSuccess(e)}/></Content>)
266
+        }
267
+      </Layout>
268
+
269
+      {/* 编辑页 */}
270
+      <WrappedModalEdiForm visibleData={visibleData} onCancel={e => onCancel(e)} onSuccess={e => onSuccess(e)}/>
271
+    </>
272
+  )
273
+}
274
+
275
+export default buildingImage

+ 31
- 19
src/pages/building/list/add/components/imageSet.jsx Прегледај датотеку

@@ -1,5 +1,5 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Radio, Tag, Tooltip, Tabs, Table, notification } from 'antd';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Radio, Tag, Tooltip, Tabs, Table, notification, Modal } from 'antd';
3 3
 import moment from 'moment';
4 4
 import request from '../../../../../utils/request';
5 5
 import apis from '../../../../../services/apis';
@@ -7,6 +7,8 @@ import Styles from '../style.less';
7 7
 import { router } from 'umi';
8 8
 import ModalImage from './modalImage';
9 9
 
10
+const { confirm } = Modal;
11
+
10 12
 
11 13
 const saleType = [
12 14
   {
@@ -51,7 +53,7 @@ function imageSet(props) {
51 53
 
52 54
   function getList(params) {
53 55
     // 网路请求
54
-    request({ ...apis.building.buildingApartment, urlData: { id: props.building.buildingId }, params: { ...params } }).then(res => {
56
+    request({ ...apis.building.buildingApartment, urlData: { id: props.building.buildingId }, params: { ...params, apartmentType: 'apart' } }).then(res => {
55 57
       setData(res)
56 58
     }).catch(err => {
57 59
       openNotificationWithIcon('error', err.message)
@@ -82,13 +84,22 @@ function imageSet(props) {
82 84
    * @param {*} record
83 85
    */
84 86
   function deleteApartment(record) {
85
-    // 网路请求
86
-    request({ ...apis.building.buildingApartmentDelete, urlData: { id: record.apartmentId } }).then(res => {
87
-      getList()
88
-      openNotificationWithIcon('success', '操作成功')
89
-    }).catch(err => {
90
-      // openNotificationWithIcon('error', err.message)
91
-    })
87
+    confirm({
88
+      title: '确认删除当前数据?',
89
+      content: '确定后成功删除,点击取消则放弃当前操作',
90
+      okText: '确定',
91
+      cancelText: '取消',
92
+      onOk() {
93
+        // 网路请求
94
+        request({ ...apis.building.buildingApartmentDelete, urlData: { id: record.apartmentId } }).then(res => {
95
+          getList()
96
+          openNotificationWithIcon('success', '操作成功')
97
+        }).catch(err => {
98
+          // openNotificationWithIcon('error', err.message)
99
+        })
100
+      },
101
+      onCancel() {},
102
+    });
92 103
   }
93 104
 
94 105
 
@@ -98,12 +109,6 @@ function imageSet(props) {
98 109
       dataIndex: 'apartmentName',
99 110
       key: 'apartmentName',
100 111
     },
101
-    {
102
-      title: '类型',
103
-      dataIndex: 'apartmentType',
104
-      key: 'apartmentType',
105
-      render: (_, record) => <span>{ record.apartmentType === 'apart' ? '户型' : '相册' }</span>,
106
-    },
107 112
     {
108 113
       title: '销售状态',
109 114
       dataIndex: 'marketStatus',
@@ -111,9 +116,16 @@ function imageSet(props) {
111 116
       render: (_, record) => <span>{ (saleType.filter(x => x.id == record.marketStatus)[0] || {}).name }</span>,
112 117
     },
113 118
     {
114
-      title: '备注',
115
-      dataIndex: 'remark',
116
-      key: 'remark',
119
+      title: '面积',
120
+      dataIndex: 'buildingArea',
121
+      key: 'buildingArea',
122
+      render: (buildingArea, _) => <span>{ `${buildingArea}m²` }</span>,
123
+    },
124
+    {
125
+      title: '套内面积',
126
+      dataIndex: 'insideArea',
127
+      key: 'insideArea',
128
+      render: (insideArea, _) => <span>{ `${insideArea}m²` }</span>,
117 129
     },
118 130
     {
119 131
       title: '创建时间',
@@ -141,7 +153,7 @@ function imageSet(props) {
141 153
 
142 154
       {/* 编辑页 */}
143 155
       {/*  onSuccess是子组件传递事件信息  */}
144
-      <ModalImage visibleData={visibleData} key={1} onSuccess={() => onModalChange()}/>
156
+      <ModalImage visibleData={visibleData} key="ModalImage" onSuccess={() => onModalChange()}/>
145 157
     </>
146 158
   )
147 159
 }

+ 20
- 31
src/pages/building/list/add/components/modalImage.jsx Прегледај датотеку

@@ -30,7 +30,7 @@ const formItemLayout = {
30 30
 const saleType = [
31 31
   {
32 32
     id: 1,
33
-    name: '待',
33
+    name: '待',
34 34
   },
35 35
   {
36 36
     id: 2,
@@ -118,6 +118,7 @@ class ModalImage extends React.Component {
118 118
     // TODO 这里应该是要支持多图,但是封装的控件没有
119 119
     data.img = data.img.map((item, index) => ({ imgType: 'aparment', url: item, orderNo: index }))
120 120
     data.buildingId = this.props.visibleData.buildingId;
121
+    data.apartmentType = 'apart'
121 122
     const api = data.apartmentId !== undefined ? apis.building.buildingApartmentUpdate : apis.building.buildingApartmentAdd;
122 123
 
123 124
     // 网路请求
@@ -162,23 +163,18 @@ class ModalImage extends React.Component {
162 163
               <Form.Item label="编号" style={{ display: 'none' }}>
163 164
                   {getFieldDecorator('apartmentId')(<Input />)}
164 165
               </Form.Item>
165
-              <Form.Item label="名称">
166
+              <Form.Item label="户型名称">
166 167
                 {getFieldDecorator('apartmentName', {
167
-                  rules: [{ required: true, message: '请输入名称' }],
168
-                })(<Input />)}
169
-              </Form.Item>
170
-              <Form.Item label="类型">
171
-                {getFieldDecorator('apartmentType', {
172
-                  rules: [{ required: true, message: '请选择类型' }],
173
-                })(
174
-                  <Select placeholder="类型">
175
-                    <Option value="apart">户型</Option>
176
-                    <Option value="photo">相册</Option>
177
-                  </Select>,
178
-                )}
168
+                  rules: [
169
+                    { required: true, message: '请填写户型名称' },
170
+                    { max: 10, message: '户型名称不超过10个字符' },
171
+                  ],
172
+                })(<Input placeholder="户型名称不超过10个字符"/>)}
179 173
               </Form.Item>
180 174
               <Form.Item label="销售状态">
181
-                {getFieldDecorator('marketStatus')(
175
+                {getFieldDecorator('marketStatus', {
176
+                  rules: [{ required: true, message: '请选择销售状态' }],
177
+                })(
182 178
                   <Select placeholder="销售状态">
183 179
                     {
184 180
                       saleType.map((item, _) => <Option value={item.id}>{item.name}</Option>)
@@ -188,27 +184,20 @@ class ModalImage extends React.Component {
188 184
               </Form.Item>
189 185
               <Form.Item label="图片">
190 186
               {getFieldDecorator('img', {
191
-                  rules: [{ required: true, message: '请选择图片' }],
187
+                  rules: [{ required: true, message: '请上传户型图片' }],
192 188
               })(
193 189
                 <ImageListUpload />,
194 190
               )}
195 191
               </Form.Item>
196
-              <Form.Item label="面积">
197
-                {getFieldDecorator('buildingArea')(<Input />)}
198
-              </Form.Item>
199
-              <Form.Item label="套内面积">
200
-                {getFieldDecorator('insideArea')(<Input />)}
201
-              </Form.Item>
202
-              <Form.Item label="户型总价">
203
-                {getFieldDecorator('apartmentPrice')(<Input />)}
204
-              </Form.Item>
205
-              <Form.Item label="户型简介">
206
-                {getFieldDecorator('apartmentDescription')(
207
-                  <Wangedit />,
208
-                )}
192
+              <Form.Item label="面积" help="单位 ㎡">
193
+                {getFieldDecorator('buildingArea', {
194
+                  rules: [{ required: true, message: '请填写面积' }],
195
+                })(<Input type="number" />)}
209 196
               </Form.Item>
210
-              <Form.Item label="备注">
211
-                {getFieldDecorator('remark')(<TextArea rows={10} />)}
197
+              <Form.Item label="套内面积" help="单位 ㎡">
198
+                {getFieldDecorator('insideArea', {
199
+                  rules: [{ required: true, message: '请填写套内面积' }],
200
+                })(<Input type="number" />)}
212 201
               </Form.Item>
213 202
               <Form.Item style={{ width: '400px', margin: 'auto', display: 'flex', justifyContent: 'space-between' }}>
214 203
                 <Button type="primary" htmlType="submit">保存</Button>

+ 3
- 2
src/pages/building/list/add/components/poster.jsx Прегледај датотеку

@@ -140,10 +140,11 @@ const Poster = props => {
140 140
         <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
141 141
       </div>
142 142
       <div >
143
-        <div style={{ display: 'flex', width: '100%', margin: '60px 0' }}>
144
-          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}><span style={{ color: 'red' }}>*</span> 海报图</p>
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 145
           <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
146 146
         </div>
147
+        <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于楼盘海报</p>
147 148
         <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
148 149
           <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
149 150
           <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />

+ 2
- 1
src/pages/building/list/add/components/share.jsx Прегледај датотеку

@@ -84,9 +84,10 @@ const Share = props => {
84 84
       <Input placeholder="请输入分享标题" value={inputValue} onChange={e => changeInput(e.target.value)} />
85 85
     </div>
86 86
     <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
87
-      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享图</p>
87
+      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>楼盘分享图</p>
88 88
       <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
89 89
     </div>
90
+    <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginTop: '20px' }}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于楼盘分享好友</p>
90 91
     <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
91 92
     <Button onClick={() => router.go(-1)}>取消</Button>
92 93
   </div>

+ 30
- 18
src/pages/building/list/add/index.jsx Прегледај датотеку

@@ -1,5 +1,5 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Radio, Tag, Tooltip, Tabs } from 'antd';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Radio, Tag, Tooltip, Tabs, notification } from 'antd';
3 3
 import moment from 'moment';
4 4
 import request from '../../../../utils/request';
5 5
 import apis from '../../../../services/apis';
@@ -11,9 +11,10 @@ import ImageUpload from '../../../../components/XForm/ImageUpload'
11 11
 import Wangedit from '../../../../components/Wangedit/Wangedit'
12 12
 import TagGroup from './components/tags'
13 13
 import Base from './components/base'
14
-import ImageSet from './components/imageSet'
14
+import Apartment from './components/imageSet'
15 15
 import Poster from './components/poster'
16 16
 import Share from './components/share'
17
+import BuildingImage from './components/buildingImage';
17 18
 
18 19
 
19 20
 const { Option } = Select
@@ -30,37 +31,48 @@ const formItemLayout = {
30 31
   },
31 32
 };
32 33
 
34
+function openNotificationWithIcon(type, message) {
35
+  notification[type]({
36
+    message,
37
+    description:
38
+      '',
39
+  });
40
+}
41
+
33 42
 function AddBuilding(props) {
34 43
 
35 44
   const [tab, setTab] = useState('base')
45
+  const [buildingData, setBuildingData] = useState({ buildingId: undefined })
36 46
 
37 47
   function tabsCallback(e) {
38 48
     console.log(e);
39
-    setTab(e.target.value)
49
+    if (!buildingData.buildingId) {
50
+      openNotificationWithIcon('error', '请先保存基本信息')
51
+    } else {
52
+      setTab(e.target.value)
53
+    }
40 54
   }
41 55
 
42
-  // console.log(props.location)
56
+  // building 回调
57
+  function buildingOnSuccess(e) {
58
+    setBuildingData(e)
59
+  }
43 60
 
44 61
   return (
45 62
     <>
46 63
       <Radio.Group value={ tab } buttonStyle="solid" onChange={e => tabsCallback(e)}>
47 64
         <Radio.Button value="base">基本信息</Radio.Button>
48
-        {
49
-          props.location.query.id &&
50
-          (
51
-            <>
52
-              <Radio.Button value="image">户型库</Radio.Button>
53
-              <Radio.Button value="poster">海报图片</Radio.Button>
54
-              <Radio.Button value="share">分享设置</Radio.Button>
55
-            </>
56
-          )
57
-        }
65
+        <Radio.Button value="apartment">户型库</Radio.Button>
66
+        <Radio.Button value="image">项目相册</Radio.Button>
67
+        <Radio.Button value="poster">海报图片</Radio.Button>
68
+        <Radio.Button value="share">分享设置</Radio.Button>
58 69
       </Radio.Group>
59 70
       <div style={{ marginTop: '20px' }}>
60
-        { tab === 'base' && <Base building={{ buildingId: props.location.query && props.location.query.id }} /> }
61
-        { props.location.query.id && (tab === 'image' && <ImageSet building={{ buildingId: props.location.query && props.location.query.id }} />)}
62
-        { props.location.query.id && (tab === 'poster' && <Poster building={{ buildingId: props.location.query && props.location.query.id }} />)}
63
-        { props.location.query.id && (tab === 'share' && <Share building={{ buildingId: props.location.query && props.location.query.id }} />)}
71
+        { tab === 'base' && <Base building={{ buildingId: buildingData.buildingId || (props.location.query && props.location.query.id) }} onSuccess={e => buildingOnSuccess(e)}/> }
72
+        { (tab === 'apartment' && <Apartment building={buildingData} />)}
73
+        { (tab === 'image' && <BuildingImage building={buildingData} />)}
74
+        { (tab === 'poster' && <Poster building={buildingData} />)}
75
+        { (tab === 'share' && <Share building={buildingData} />)}
64 76
       </div>
65 77
     </>
66 78
     // <Tabs defaultActiveKey="1" onChange={tabsCallback}>

+ 11
- 10
src/pages/building/list/index.jsx Прегледај датотеку

@@ -86,7 +86,7 @@ function CartBody(props) {
86 86
           openNotificationWithIcon('success', '操作成功')
87 87
           props.onSuccess()
88 88
         }).catch(err => {
89
-          openNotificationWithIcon('error', err.message)
89
+          // openNotificationWithIcon('error', err.message)
90 90
         })
91 91
 
92 92
         modal.destroy();
@@ -97,13 +97,13 @@ function CartBody(props) {
97 97
     });
98 98
   }
99 99
 
100
-  const { buildingImg = []} = data
101
-
100
+  const { buildingImg } = data
101
+  console.log("buildingImg: ", data.buildingImg, "data: ", data)
102 102
   return (
103 103
     <Card
104 104
       hoverable
105 105
       style={{ minWidth: '330px', borderRadius: '12px', margin: '10px', boxShadow: '0px 0px 16px 2px rgba(0,0,0,0.12)' }}
106
-      cover={<img alt="example" src={(buildingImg[0] || {}).url} style={{ borderRadius: '12px 12px 0 0', width: '100%', height: '14vw' }}></img>}
106
+      cover={<img alt="example" src={((data.buildingImg && data.buildingImg[0]) || {}).url} style={{ borderRadius: '12px 12px 0 0', width: '100%', height: '14vw' }}></img>}
107 107
       bodyStyle={{ padding: '10px 20px' }}
108 108
     >
109 109
       <p className={Styles.cardText}>
@@ -118,12 +118,12 @@ function CartBody(props) {
118 118
       </p>
119 119
       <p className={Styles.cardText}>
120 120
         <span className={Styles.title}>楼盘名称</span>
121
-        <span >:{data.name}</span>
121
+        <span >:{data.buildingName || data.name}</span>
122 122
       </p>
123 123
       <p className={Styles.cardItem}>
124 124
         <span className={Styles.title}>均价</span>
125 125
         <span >
126
-          :约<span style={{ color: '#FF0707', fontSize: '20px' }}> {data.price} </span>元/m²
126
+          :约<span style={{ color: '#FF0707', fontSize: '20px' }}> {data.price || '待定'} </span>元/m²
127 127
         </span>
128 128
       </p>
129 129
       <p className={Styles.cardItem}>
@@ -220,7 +220,7 @@ function body(props) {
220 220
   // 分页
221 221
   function onChange(pageNumber) {
222 222
     // eslint-disable-next-line react-hooks/rules-of-hooks
223
-    getList({ pageNum: pageNumber, pageSize: 9 })
223
+    getList({ pageNum: pageNumber, pageSize: 9, ...props.form.getFieldsValue() })
224 224
   }
225 225
 
226 226
   function getDate(value, dateString) {
@@ -238,6 +238,7 @@ function body(props) {
238 238
    */
239 239
   function handleReset() {
240 240
     props.form.resetFields();
241
+    getList({ pageNum: 1, pageSize: 9 })
241 242
   }
242 243
 
243 244
 
@@ -269,7 +270,7 @@ function body(props) {
269 270
           {getFieldDecorator('buildingStatus')(
270 271
             <Select style={{ width: '180px' }} placeholder="楼盘状态" onChange={handleSelectChange}>
271 272
               <Option value="1">发布</Option>
272
-              <Option value="0">未发布</Option>
273
+              <Option value="2">未发布</Option>
273 274
             </Select>,
274 275
           )}
275 276
         </Form.Item>
@@ -291,7 +292,7 @@ function body(props) {
291 292
           {getFieldDecorator('isMain')(
292 293
             <Select style={{ width: '180px' }} placeholder="首页推荐" onChange={handleSelectChange}>
293 294
               <Option value="1">首页推荐</Option>
294
-              <Option value="0">首页未推荐</Option>
295
+              <Option value="2">首页未推荐</Option>
295 296
             </Select>,
296 297
           )}
297 298
         </Form.Item>
@@ -323,7 +324,7 @@ function body(props) {
323 324
       </Row>
324 325
       {/* 分页 */}
325 326
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
326
-        <Pagination showQuickJumper defaultCurrent={1} total={dataSource.total} onChange={onChange} pageSize={dataSource.size} current={dataSource.current}/>
327
+        <Pagination showQuickJumper defaultCurrent={1} total={dataSource.total} onChange={onChange} pageSize={dataSource.size} />
327 328
       </div>
328 329
     </>
329 330
   );

+ 3
- 2
src/pages/building/type/index.jsx Прегледај датотеку

@@ -15,8 +15,9 @@ function body() {
15 15
   const columns = [
16 16
     {
17 17
       title: '编号',
18
-      dataIndex: 'buildingTypeId',
19
-      key: 'buildingTypeId',
18
+      dataIndex: 'index',
19
+      key: 'index',
20
+      render: (text, record, index) => <span>{index + 1}</span>,
20 21
     },
21 22
     {
22 23
       title: '类型名称',

+ 9
- 8
src/pages/carouselFigure/SelectNews.jsx Прегледај датотеку

@@ -1,10 +1,10 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import{ Select, Modal } from 'antd';
2
+import { Select, Modal } from 'antd';
3 3
 import { apis, fetch } from '../../utils/request';
4 4
 
5 5
 const getNewsList = fetch(apis.news.getList)
6 6
 
7
-export default (props) => {
7
+export default props => {
8 8
   const {
9 9
     value,
10 10
     onChange,
@@ -13,21 +13,21 @@ export default (props) => {
13 13
 
14 14
   const [list, setList] = useState([]);
15 15
   const [visible, setVisible] = useState(false);
16
-  const [ news, setNews ] = useState({ newsId: undefined, newsName: '请选择资讯' })
17
-  const getNewsTitle = val => ((list.filter(x => x.newsId === val)[0]) || {}).newsName || '请选择资讯'
16
+  const [news, setNews] = useState({ newsId: undefined, newsName: '请选择资讯' })
17
+  const getNewsTitle = val => ((list.filter(x => x.newsId == val)[0]) || {}).newsName || '请选择资讯'
18 18
   const updateNews = val => setNews({ newsId: val, newsName: getNewsTitle(val) })
19 19
 
20 20
   const buildingId = props.buildingId()
21
-  
21
+
22 22
   useEffect(() => {
23 23
     getNewsList({
24 24
       params: {
25 25
         buildingId,
26 26
         pageNum: 1,
27 27
         pageSize: 999,
28
-      }
29
-    }).then((data) => {
30
-      setList(data.list || [])
28
+      },
29
+    }).then(data => {
30
+      setList(data.records || [])
31 31
 
32 32
       updateNews(buildingId ? undefined : value);
33 33
     })
@@ -41,6 +41,7 @@ export default (props) => {
41 41
     onChange(val)
42 42
   }
43 43
 
44
+  console.log(value, typeof value)
44 45
   return (
45 46
     <div>
46 47
       <div onClick={() => setVisible(true)}>{news.newsName}</div>

+ 7
- 7
src/pages/carouselFigure/advertisingList.jsx Прегледај датотеку

@@ -55,13 +55,13 @@ const toEdit = (contentId) => () => {
55 55
       align: 'center',
56 56
       render: (contentType) => <span>{ contentType === 'project' ? '项目' : contentType === 'activity' ? '活动' : contentType === 'news' ? '资讯' : contentType === 'other' ? '其他' : contentType === 'help' ? '助力' : contentType === 'group' ? '拼团' : '' }</span>
57 57
     },
58
-    {
59
-      title: '发布位置',
60
-      dataIndex: 'showPosition',
61
-      key: 'showPosition',
62
-      align: 'center',
63
-      render: (showPosition) => <span>{ showPosition === 'index' ? '首页' : showPosition === 'mall' ? '商城' : '' }</span>
64
-    },
58
+    // {
59
+    //   title: '发布位置',
60
+    //   dataIndex: 'showPosition',
61
+    //   key: 'showPosition',
62
+    //   align: 'center',
63
+    //   render: (showPosition) => <span>{ showPosition === 'index' ? '首页' : showPosition === 'mall' ? '商城' : '' }</span>
64
+    // },
65 65
     {
66 66
       title: '发布时间',
67 67
       dataIndex: 'createDate',

+ 2
- 2
src/pages/carouselFigure/editAdvertising.jsx Прегледај датотеку

@@ -77,11 +77,11 @@ import SelectGroup from './SelectGroup';
77 77
         value: data.buildingId,
78 78
       },
79 79
       {
80
-        label: '商品图片',
80
+        label: '开屏广告',
81 81
         name: 'image',
82 82
         type: FieldTypes.ImageUploader,
83 83
         value: data.image,
84
-        help: '建议图片尺寸:640px*960px',
84
+        help: '建议图片尺寸:640*960px,比例2:3,格式:jpg,用于开屏广告',
85 85
       },
86 86
       {
87 87
         label: '标题',

+ 7
- 3
src/pages/carouselFigure/editCarousel.jsx Прегледај датотеку

@@ -28,15 +28,19 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
28 28
   let helpVisible = false
29 29
   let groupVisible = false
30 30
   let buildingId = ''
31
+  let locationType = false
31 32
 
32 33
   const setExtraData = data => {
34
+    console.log(data, 'data');
33 35
     contentVisible = data.contentType === 'other';
34 36
     activityVisible = data.contentType === 'activity';
35 37
     newsVisible = data.contentType === 'news';
36 38
     helpVisible = data.contentType === 'help';
37 39
     groupVisible = data.contentType === 'group';
38
-
40
+    
39 41
     buildingId = data.buildingId
42
+    locationType = data.showPosition === 'mall';
43
+    console.log(locationType, 'locationType');
40 44
   }
41 45
 
42 46
     
@@ -81,11 +85,11 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
81 85
           value: data.buildingId,
82 86
         },
83 87
         {
84
-          label: '商品图片',
88
+          label: locationType ? '积分商城轮播图' : '首页轮播图',
85 89
           name: 'image',
86 90
           type: FieldTypes.ImageUploader,
87 91
           value: data.image,
88
-          help: '建议图片尺寸:640px*330px',
92
+          help: locationType ? '建议图片尺寸:750*420px,比例16:9,格式:jpg,用于积分商城banner轮播':'建议图片尺寸:750*600px,比例5:4,格式:jpg,用于首页顶部banner轮播',
89 93
         },
90 94
         {
91 95
           label: '标题',

+ 0
- 6
src/pages/channel/channelList.jsx Прегледај датотеку

@@ -72,12 +72,6 @@ const columns = [
72 72
     key: 'recommendCount',
73 73
     align: 'center',
74 74
   },
75
-  {
76
-    title: '邀请经纪人',
77
-    dataIndex: 'inviteCount',
78
-    key: 'inviteCount',
79
-    align: 'center',
80
-  },
81 75
   {
82 76
     title: '操作',
83 77
     dataIndex: '',

+ 18
- 13
src/pages/customer/customerlist/components/attribution.jsx Прегледај датотеку

@@ -21,18 +21,19 @@ class ModalAttribution extends React.Component {
21 21
     super(props);
22 22
     this.state = {
23 23
        dataSource: { records: [] },
24
-       visibleData: { visible: false, customerId: '', realtyConsultant: '' },
24
+       visibleData: { visible: false, customerId: '', realtyConsultant: '', buildingId: '' },
25 25
     }
26 26
   }
27 27
 
28 28
   // 挂载之后
29 29
   componentDidMount() {
30
-    this.getList({ pageNumber: 1, pageSize: 5 })
30
+    // this.getList({ pageNumber: 1, pageSize: 5 })
31 31
   }
32 32
 
33 33
   componentDidUpdate(preProps, preState) {
34
+    console.log(this.props.visibleData)
34 35
     if (this.props.visibleData.visible !== preState.visibleData.visible) {
35
-      this.getList({ pageNumber: 1, pageSize: 5 })
36
+      this.getList({ pageNumber: 1, pageSize: 5, buildingId: this.props.visibleData.buildingId })
36 37
       this.setState({ visibleData: this.props.visibleData });
37 38
     }
38 39
   }
@@ -49,8 +50,12 @@ class ModalAttribution extends React.Component {
49 50
   }
50 51
 
51 52
   getList(params) {
53
+    console.log('params: ', params)
54
+    if (params.buildingId === '' || params.buildingId === null || params.buildingId === undefined) {
55
+      return
56
+    }
52 57
     // 网路请求
53
-    request({ ...apis.customer.consultant, params: { ...params } }).then(res => {
58
+    request({ ...apis.customer.buildingConsultant, params: { ...params } }).then(res => {
54 59
       this.setState({ dataSource: res })
55 60
     }).catch(err => {
56 61
       // eslint-disable-next-line no-unused-expressions
@@ -68,13 +73,13 @@ class ModalAttribution extends React.Component {
68 73
 
69 74
    // 分页
70 75
   onChange(pageNum) {
71
-    this.getList({ pageNumber: pageNum, pageSize: 5 })
76
+    this.getList({ pageNumber: pageNum, pageSize: 5, buildingId: this.props.visibleData.buildingId })
72 77
   }
73 78
 
74 79
   // 提交
75 80
   submitGm(record) {
76 81
     // 网路请求
77
-    request({ ...apis.customer.recommendEdit, urlData: { id: this.state.visibleData.customerId }, data: { customerId: this.state.visibleData.customerId, realtyConsultant: record.personId } }).then(res => {
82
+    request({ ...apis.customer.recommendEdit, urlData: { id: this.state.visibleData.customerId }, data: { customerId: this.state.visibleData.customerId, realtyConsultant: record.userId } }).then(res => {
78 83
       // eslint-disable-next-line no-unused-expressions
79 84
       this.openNotificationWithIcon('success', '操作成功')
80 85
       this.handleCancel()
@@ -88,13 +93,13 @@ class ModalAttribution extends React.Component {
88 93
     const columns = [
89 94
       // {
90 95
       //   title: '编号',
91
-      //   dataIndex: 'personId',
92
-      //   key: 'personId',
96
+      //   dataIndex: 'userId',
97
+      //   key: 'userId',
93 98
       // },
94 99
       {
95 100
         title: '姓名',
96
-        dataIndex: 'name',
97
-        key: 'name',
101
+        dataIndex: 'userName',
102
+        key: 'userName',
98 103
       },
99 104
       {
100 105
         title: '电话',
@@ -108,15 +113,15 @@ class ModalAttribution extends React.Component {
108 113
       },
109 114
       {
110 115
         title: '岗位',
111
-        dataIndex: 'post',
112
-        key: 'post',
116
+        dataIndex: 'position',
117
+        key: 'position',
113 118
       },
114 119
       {
115 120
         title: '操作',
116 121
         dataIndex: 'personId',
117 122
         key: 'personId',
118 123
         // eslint-disable-next-line no-nested-ternary
119
-        render: (_, record) => <>{ this.props.visibleData.realtyConsultant !== record.personId && <Button type="danger" onClick={() => this.submitGm(record)}>确定</Button>}</>,
124
+        render: (_, record) => <>{ this.props.visibleData.realtyConsultant != record.userId && <Button type="danger" onClick={() => this.submitGm(record)}>确定</Button>}</>,
120 125
       },
121 126
     ]
122 127
     return (

+ 145
- 0
src/pages/customer/customerlist/components/recommend.jsx Прегледај датотеку

@@ -0,0 +1,145 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Radio, Modal, Descriptions, notification } 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
+/**
14
+ * 推荐客户
15
+ *
16
+ * @param {*} props
17
+ * @returns
18
+ */
19
+class ModalRecommendRecord extends React.Component {
20
+  constructor(props) {
21
+    super(props);
22
+    this.state = {
23
+       dataSource: [],
24
+       visibleData: { visible: false, customerId: '' },
25
+    }
26
+  }
27
+
28
+  // 挂载之后
29
+  componentDidMount() {
30
+    this.getList({ pageNumber: 1, pageSize: 5 })
31
+  }
32
+
33
+  componentDidUpdate(preProps, preState) {
34
+    // console.log('this.props.visibleData', this.props.visibleData)
35
+    if (this.props.visibleData.customerId !== preState.visibleData.customerId) {
36
+      this.getList({ pageNumber: 1, pageSize: 5 })
37
+      this.setState({ visibleData: this.props.visibleData });
38
+    }
39
+  }
40
+
41
+  // 弹框确定按钮
42
+  // eslint-disable-next-line react/sort-comp
43
+  handleOk() {
44
+    this.setState({ visibleData: { visible: false, customerId: '' } })
45
+  }
46
+
47
+  // 弹框取消按钮
48
+  handleCancel() {
49
+    this.setState({ visibleData: { visible: false, customerId: '' } })
50
+  }
51
+
52
+  openNotificationWithIcon = (type, message) => {
53
+    notification[type]({
54
+      message,
55
+      description:
56
+        '',
57
+    });
58
+  }
59
+
60
+  getList(params) {
61
+    const { customerId } = this.state.visibleData
62
+    if (customerId === '' || customerId === undefined) {
63
+      return
64
+    }
65
+    console.log('customerId', customerId)
66
+    // 网路请求
67
+    // 网路请求
68
+    request({ ...apis.customer.recommendClient, urlData: { id: customerId }, params: { ...params } }).then(res => {
69
+      this.setState({ dataSource: res })
70
+    }).catch(err => {
71
+      this.openNotificationWithIcon('error', err)
72
+    })
73
+  }
74
+
75
+   // 分页
76
+  onChange(pageNum) {
77
+    this.getList({ pageNumber: pageNum, pageSize: 5 })
78
+  }
79
+
80
+  render() {
81
+    const columns = [
82
+      {
83
+        title: '头像',
84
+        // eslint-disable-next-line jsx-a11y/alt-text
85
+        render: (text, records) => <img src={records.picture} width={50} height={50} />,
86
+      },
87
+      {
88
+        title: '用户名',
89
+        dataIndex: 'name',
90
+        key: 'name',
91
+      },
92
+      {
93
+        title: '电话',
94
+        dataIndex: 'phone',
95
+        key: 'phone',
96
+      },
97
+      {
98
+        title: '性别',
99
+        dataIndex: 'sex',
100
+        key: 'sex',
101
+        render: (text, records) => <span>{records.sex === 1 ? '男' : '女'}</span>,
102
+      },
103
+      {
104
+        title: '意向项目',
105
+        dataIndex: 'intention',
106
+        key: 'intention',
107
+      },
108
+      {
109
+        title: '推荐时间',
110
+        dataIndex: 'createDate',
111
+        key: 'createDate',
112
+        render: (_, record) => <><span>{ record.createDate && moment(record.createDate).format('YYYY-MM-DD') }</span></>,
113
+      },
114
+      {
115
+        title: '状态',
116
+        // eslint-disable-next-line consistent-return
117
+        render: (text, records) => {
118
+          if (records.status === 1) { return '报备' }
119
+          if (records.status === 2) { return '到访' }
120
+          if (records.status === 3) { return '认筹' }
121
+          if (records.status === 4) { return '签约' }
122
+          // reportRecommendStatus
123
+        },
124
+      },
125
+    ]
126
+    return (
127
+      <>
128
+        <Modal
129
+            title="推荐客户"
130
+            width={800}
131
+            destroyOnClose="true"
132
+            footer={null}
133
+            visible={this.state.visibleData.visible}
134
+            // onOk={() => this.handleOk()}
135
+            onCancel={(e) => this.handleCancel(e)}
136
+          >
137
+            {console.log('this.state.dataSource', this.state.dataSource)}
138
+            <Table dataSource={this.state.dataSource.records} rowKey="integralrecord" columns={columns} pagination={{ total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
139
+          </Modal>
140
+      </>
141
+    );
142
+  }
143
+}
144
+
145
+export default ModalRecommendRecord

+ 88
- 32
src/pages/customer/customerlist/customerDetail.jsx Прегледај датотеку

@@ -1,5 +1,5 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Table } from 'antd';
2
+import { Form, Table, Pagination } from 'antd';
3 3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4 4
 import styles from './style.less';
5 5
 import apis from '../../../services/apis';
@@ -16,6 +16,8 @@ function header(props) {
16 16
    */
17 17
   // eslint-disable-next-line react-hooks/rules-of-hooks
18 18
   const [data, setData] = useState([{ visitRecords: [] }])
19
+  const [dataConsultant, setDataonsultant] = useState({})
20
+  const [intentionData, setIntentionData] = useState([])
19 21
 
20 22
   // eslint-disable-next-line react-hooks/rules-of-hooks
21 23
   useEffect(() => {
@@ -31,9 +33,13 @@ function header(props) {
31 33
 
32 34
     request({ ...apis.customer.CustomerRecommendGet, urlData: { id }, params: { ...params } }).then(res => {
33 35
       setData(res)
36
+      setDataonsultant(res.geoInfo)
34 37
     })
35 38
   }
36
-
39
+// 分页
40
+  const changePageNum = pageNumber => {
41
+    // getList({ pageNum: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
42
+  }
37 43
   const columns = [
38 44
     {
39 45
       title: '访问事件',
@@ -56,16 +62,79 @@ function header(props) {
56 62
       render: (_, record) => <span>{record.visitDuration === null ? 0 : record.visitDuration }秒</span>,
57 63
     },
58 64
   ]
65
+  // 意向
66
+  const intention = [
67
+    {
68
+      title: 'Name',
69
+      dataIndex: 'name',
70
+      width: 150,
71
+      render: (_, record) => <span>香颂半岛</span>,
72
+    },
73
+    {
74
+      title: 'Address',
75
+      dataIndex: 'address',
76
+      render: (_, record) => <span style={{ marginLeft: '55%' }}>22</span>,
77
+    },
78
+  ];
79
+
80
+for (let i = 0; i < 100; i++) {
81
+  intentionData.push({
82
+    key: i,
83
+    name: `Edward King ${i}`,
84
+    age: 32,
85
+    address: `London, Park Lane no. ${i}`,
86
+  });
87
+}
59 88
   return (
60 89
     <>
61 90
       <div className={styles.cardBox}>
62
-        <div className={styles.leftBox}>
63
-          <p className={styles.tit}>置业顾问信息</p>
64
-          <img className={styles.touxiang} src={ data.consultant && data.consultant.picture } />
65
-          <p className={styles.infoItem}>姓名:{ data.consultant && data.consultant.name }</p>
66
-          <p className={styles.infoItem}>部门:{ data.consultant && data.consultant.department }</p>
67
-          <p className={styles.infoItem}>岗位:{ data.consultant && data.consultant.post }</p>
91
+     {/* { console.log("data:",data),console.log("data:",dataConsultant)} */}
92
+        <div className={styles.rightBox}>
93
+          <p className={styles.tit}>客户信息</p>
94
+          <img className={styles.touxiang} src={ data.picture && data.picture } />
95
+          <div className={styles.right}>
96
+            <p className={styles.rightItem}>用户名称:{ data.name }</p>
97
+            <p className={styles.rightItem}>手机号码:{ data.phone }</p>
98
+            <p className={styles.rightItem}>首次访问时间:{data.visitTime && moment(data.visitTime).format('YYYY-MM-DD')}</p>
99
+          </div>
100
+          <div className={styles.Centered}>
101
+          <p>访问时长:{ data.duration }秒</p>
102
+          <p>访问次数:{ data.visitTimes }</p>
103
+          <p className={styles.rightItem}>客户描述:{ data.describe }</p>
104
+          {/* <p>预约人数:{ data.visiteNum }</p> */}
105
+          </div>
106
+          <div className={styles.rightCentered}>
107
+          <p >需求类型:{ data.demandType }</p>
108
+          <p >价格区间:{data.priceRange }</p>
109
+          <p >物业类型:{ data.realtyManageType }</p>
110
+          {/* <p>预约人数:{ data.visiteNum }</p> */}
111
+          </div>
112
+          {/* <p className={styles.rightItem}>预约到访时间:{data.appointmentTime && moment(data.appointmentTime).format('YYYY-MM-DD') }</p> */}
113
+          <div className={styles.rightInfo}>
114
+            <p className={styles.rightItem}>国家:{ dataConsultant&&dataConsultant.country }</p>
115
+            <p className={styles.rightItem}>省份:{ dataConsultant&&dataConsultant.provience }</p>
116
+            <p className={styles.rightItem}>城市:{dataConsultant&&dataConsultant.city }</p>
117
+            <p className={styles.rightItem}>来访渠道:活动分享</p>
118
+            {/* <p className={styles.rightItem}>详细信息:</p> */}
119
+            {/* <p className={styles.rightItem}>意向项目:{data.intention }</p> */} 
120
+            {/* <p className={styles.rightItem}>客户说明:{ data.verifyRemark }</p> */}
121
+          </div>
122
+        </div>
123
+        
124
+      </div>
125
+      <br></br>
126
+      <div className={styles.cardBox}>
127
+        <div className={styles.rightBoxCentre}>
128
+        <p className={styles.tit}>置业顾问信息</p>
129
+          <img className={styles.touxiang} src={ data.picture && data.picture } />
130
+          <p className={styles.infoItem}>曹玉文</p>
131
+          <div className={styles.right}>
132
+          {/* <p className={styles.infoItem}>姓名:{ data.consultant && data.consultant.name }</p>
133
+          <p className={styles.infoItem}>部门:{ data.consultant && data.consultant.department }</p> */}
68 134
           <p className={styles.infoItem}>号码:{ data.consultant && data.consultant.phone } </p>
135
+          <p className={styles.infoItem}>岗位:{ data.consultant && data.consultant.post }</p>
136
+          </div>
137
+          <div className={styles.left}>
69 138
           <p className={styles.infoItem}>公司:{ data.consultant && data.consultant.company } </p>
70 139
           <p className={styles.infoItem}>
71 140
             所属项目:
@@ -73,37 +142,24 @@ function header(props) {
73 142
               data.consultant && data.consultant.projects.map((item, _) => <span>{item}</span>)
74 143
             }
75 144
           </p>
145
+          </div>
76 146
         </div>
77
-        <div className={styles.rightBox}>
78
-          <p className={styles.tit}>客户信息</p>
79
-          <img className={styles.touxiang} src={ data.picture && data.picture } />
80
-          <div className={styles.right}>
81
-            <p className={styles.rightItem}>用户名称:{ data.name }</p>
82
-            <p className={styles.rightItem}>手机号码:{ data.phone }</p>
83
-            <p className={styles.rightItem}>来访渠道:活动分享</p>
147
+        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
148
+        <div className={styles.leftBoxCentre}>
149
+          <div className={styles.tit}>
150
+                <span>项目名称</span>
151
+                <span style={{ marginLeft: '47%' }}>项目名称</span>
84 152
           </div>
85
-          <p className={styles.rightItem}>访问时长:{ data.duration }秒</p>
86
-          <p className={styles.rightItem}>访问次数:{ data.visitTimes }</p>
87
-          <p className={styles.rightItem}>预约人数:{ data.visiteNum }</p>
88
-          <p className={styles.rightItem}>首次访问时间:{data.visitTime && moment(data.visitTime).format('YYYY-MM-DD')}</p>
89
-          <p className={styles.rightItem}>预约到访时间:{data.appointmentTime && moment(data.appointmentTime).format('YYYY-MM-DD') }</p>
90
-          <div className={styles.rightInfo}>
91
-            <p className={styles.rightItem}>国家:{ data.country }</p>
92
-            <p className={styles.rightItem}>省份:{ data.province }</p>
93
-            <p className={styles.rightItem}>城市:{data.city }</p>
94
-            <p className={styles.rightItem}>详细信息:</p>
95
-            <p className={styles.rightItem}>意向项目:{data.intention }</p>
96
-            <p className={styles.rightItem}>价格区间:{data.priceRange }</p>
97
-            <p className={styles.rightItem}>客户说明:{ data.verifyRemark }</p>
98
-            <p className={styles.rightItem}>客户描述:{ data.describe }</p>
99
-            <p className={styles.rightItem}>需求类型:{ data.demandType }</p>
100
-            <p className={styles.rightItem}>物业类型:{ data.realtyManageType }</p>
153
+          {/* <img className={styles.touxiang} src={ data.picture && data.picture } /> */}
154
+          <div className={styles.infoItem}>
155
+          <Table columnWidth={10} showHeader={false} columns={intention} dataSource={intentionData} pagination={{ pageSize: 50 }} scroll={{ y: 240 }}/>,
101 156
           </div>
102 157
         </div>
158
+
103 159
       </div>
104 160
       <div className={styles.recordBox}>
105 161
         <p className={styles.tableName}>访问记录</p>
106
-        <Table dataSource={data.visitRecords} columns={columns} pagination={false} rowKey="customerDetail" />
162
+        <Table showQuickJumper defaultCurrent={1} dataSource={data.visitRecords} columns={columns} current={50} />
107 163
       </div>
108 164
 
109 165
     </>

+ 85
- 15
src/pages/customer/customerlist/index.jsx Прегледај датотеку

@@ -8,6 +8,7 @@ import router from 'umi/router';
8 8
 
9 9
 import Attribution from './components/attribution'
10 10
 import IntegralRecord from './components/integralRecord'
11
+import ModalRecommendRecord from './components/recommend'
11 12
 import ChangeStatus from './components/changeStatus'
12 13
 import BuildSelect from '../../../components/SelectButton/BuildSelect'
13 14
 import AuthButton from '@/components/AuthButton';
@@ -37,7 +38,7 @@ function body(props) {
37 38
 
38 39
   // 调整归属 ============  start
39 40
   // eslint-disable-next-line react-hooks/rules-of-hooks
40
-  const [gVisibleData, setGVisibleData] = useState({ visible: false, customerId: '', realtyConsultant: '' })
41
+  const [gVisibleData, setGVisibleData] = useState({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
41 42
   // 调整归属 ============= end
42 43
 
43 44
   // 积分记录 ============  start
@@ -50,6 +51,9 @@ function body(props) {
50 51
   const [statusVisibleData, setStatusVisibleData] = useState({ visible: false, customerId: '', status: '' })
51 52
   // 变更状态 ============= end
52 53
 
54
+  // 推荐客户
55
+  const [recommendVisibleData, setRecommendVisibleData] = useState({ visible: false, customerId: '' })
56
+
53 57
   // eslint-disable-next-line react-hooks/rules-of-hooks
54 58
   useEffect(() => {
55 59
     getList({ pageNumber: 1, pageSize: 10, customerType })
@@ -76,6 +80,7 @@ function body(props) {
76 80
     setRecordVisibleData({ visible: false, customerId: '' })
77 81
     setGVisibleData({ visible: false, customerId: '', realtyConsultant: '' })
78 82
     setStatusVisibleData({ visible: false, customerId: '', status: '' })
83
+    setRecommendVisibleData({ visible: false, customerId: '' })
79 84
   }
80 85
 
81 86
   // 提交事件
@@ -123,22 +128,33 @@ function body(props) {
123 128
   // 所有这里临时解决方法是,弹出一个Modal对话框的时候,把其他的对话框给隐藏
124 129
 
125 130
   function showGM(record) {
126
-    setGVisibleData({ visible: true, customerId: record.customerId, realtyConsultant: record.realtyConsultant })
131
+    setGVisibleData({ visible: true, customerId: record.customerId, realtyConsultant: record.realtyConsultant, buildingId: record.buildingId })
127 132
     setRecordVisibleData({ visible: false, customerId: '' })
128 133
     setStatusVisibleData({ visible: false, customerId: '' })
134
+    setRecommendVisibleData({ visible: false, customerId: '' })
129 135
   }
130 136
 
131 137
   function showRecord(record) {
132 138
     setRecordVisibleData({ visible: true, customerId: record.customerId })
133
-    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '' })
139
+    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
134 140
     setStatusVisibleData({ visible: false, customerId: '' })
141
+    setRecommendVisibleData({ visible: false, customerId: '' })
135 142
   }
136 143
 
137 144
   function showStatus(record) {
138 145
     setRecordVisibleData({ visible: false, customerId: '' })
139
-    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '' })
146
+    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
147
+    setRecommendVisibleData({ visible: false, customerId: '' })
140 148
     setStatusVisibleData({ visible: true, customerId: record.customerId, status: record.status })
141 149
   }
150
+
151
+  // 推荐客户
152
+  function showRecommend(personId) {
153
+    setRecordVisibleData({ visible: false, customerId: '' })
154
+    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
155
+    setStatusVisibleData({ visible: false, customerId: '', status: '' })
156
+    setRecommendVisibleData({ visible: true, customerId: personId })
157
+  }
142 158
   function toCustomerDateil(record) {
143 159
     router.push({
144 160
       pathname: '/customer/customerlist/customerDetail',
@@ -147,6 +163,15 @@ function body(props) {
147 163
       },
148 164
     });
149 165
   }
166
+  // 私客详情
167
+  function publicCustomerDetail(record) {
168
+    router.push({
169
+      pathname: '/customer/customerlist/publicCustomerDetail',
170
+      query: {
171
+        id: record.customerId,
172
+      },
173
+    });
174
+  }
150 175
 
151 176
   function exportCustomer () {
152 177
     const fieldsValue = getFieldsValue()
@@ -173,9 +198,18 @@ function body(props) {
173 198
 
174 199
   // 关闭调整归属的窗口
175 200
   function closeAttribution() {
176
-    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '' })
201
+    alert(1)
202
+    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
177 203
     getList({ pageNum: 1, pageSize: 10, customerType, ...props.form.getFieldsValue() })
178 204
   }
205
+  // 回调关闭所有弹框
206
+  function closeAll() {
207
+    alert(1)
208
+    setRecordVisibleData({ visible: false, customerId: '' })
209
+    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
210
+    setStatusVisibleData({ visible: false, customerId: '', status: '' })
211
+    setRecommendVisibleData({ visible: false, customerId: '' })
212
+  }
179 213
 
180 214
   const publicColumns = [
181 215
     {
@@ -202,13 +236,41 @@ function body(props) {
202 236
       align: 'center',
203 237
       width: '15%',
204 238
     },
205
-    // {
206
-    //   title: '推广人员',
207
-    //   dataIndex: 'sharePersonName',
208
-    //   key: 'sharePersonName',
209
-    //   align: 'center',
210
-    //   width: '15%',
211
-    // },
239
+    {
240
+      title: '推广人员',
241
+      dataIndex: 'sharePersonName',
242
+      key: 'sharePersonName',
243
+      align: 'center',
244
+      width: '15%',
245
+    },
246
+    {
247
+      title: '性别',
248
+      dataIndex: 'sex',
249
+      key: 'sex',
250
+      align: 'center',
251
+      width: '10%',
252
+      // eslint-disable-next-line no-nested-ternary
253
+      render: (_, record) => <><span>{record.sex === 1 ? '男' : record.sex === 2 ? '女' : '未知'}</span></>,
254
+    },
255
+    {
256
+      title: '操作',
257
+      dataIndex: 'customerId',
258
+      key: 'customerId',
259
+      align: 'center',
260
+      width: '25%',
261
+      // eslint-disable-next-line no-nested-ternary
262
+      render: (_, record) => (
263
+        <>
264
+          <AuthButton>
265
+            <Button className={customerType === 'private' ? Styles.displayS : Styles.text } type="link" onClick={() => publicCustomerDetail(record)}>查看详情</Button>
266
+          </AuthButton>
267
+          &nbsp;&nbsp;
268
+          <AuthButton>
269
+            <Button className={customerType === 'private' ? Styles.displayS : Styles.text } type="link" onClick={() => showRecommend(record.personId)}>推荐客户</Button>
270
+          </AuthButton>
271
+        </>
272
+      ),
273
+    },
212 274
   ]
213 275
 
214 276
   const privateColumns = [
@@ -290,12 +352,13 @@ function body(props) {
290 352
       // eslint-disable-next-line no-nested-ternary
291 353
       render: (_, record) => (
292 354
         <>
355
+            &nbsp;
293 356
           <AuthButton name="admin.customer.recommend.edit.id.put" noRight={null}>
294 357
             <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showStatus(record)}>变更状态</Button>
295 358
             &nbsp;&nbsp;
296 359
             <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showGM(record)}>调整归属</Button>
297 360
           </AuthButton>
298
-            <br />
361
+            &nbsp;&nbsp;
299 362
           <AuthButton name="admin.customer.recommend.get" noRight={null}>
300 363
             <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => toCustomerDateil(record)}>查看详情</Button>
301 364
           </AuthButton>
@@ -303,6 +366,10 @@ function body(props) {
303 366
           <AuthButton name="admin.mine.taPointsRecords.id.get" noRight={null}>
304 367
             <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showRecord(record)}>积分记录</Button>
305 368
           </AuthButton>
369
+            &nbsp;
370
+          <AuthButton name="admin.mine.taPointsRecords.id.get" noRight={null}>
371
+            <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showRecommend(record.customerId)}>推荐客户</Button>
372
+          </AuthButton>
306 373
         </>
307 374
       ),
308 375
     },
@@ -383,10 +450,13 @@ function body(props) {
383 450
       <Attribution visibleData={gVisibleData} onCancel={() => closeAttribution()}/>
384 451
 
385 452
       {/* 积分记录 */}
386
-      <IntegralRecord visibleData={recordVisibleData} />
453
+      <IntegralRecord visibleData={recordVisibleData} onCancel={() => closeAll()} />
387 454
 
388 455
       {/* 变更状态 */}
389
-      <ChangeStatus visibleData={statusVisibleData} />
456
+      <ChangeStatus visibleData={statusVisibleData} onCancel={() => closeAll()}/>
457
+
458
+      {/* 推荐客户 */}
459
+      <ModalRecommendRecord visibleData={recommendVisibleData} onCancel={() => closeAll()}/>
390 460
     </>
391 461
   );
392 462
 }

+ 137
- 0
src/pages/customer/customerlist/publicCustomerDetail.jsx Прегледај датотеку

@@ -0,0 +1,137 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Table, Pagination } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import publicStyle from './publicStyle.less';
5
+import apis from '../../../services/apis';
6
+import request from '../../../utils/request';
7
+import moment from 'moment';
8
+
9
+import router from 'umi/router';
10
+
11
+
12
+function header(props) {
13
+  /**
14
+   * @param {*} props
15
+   * @returns
16
+   */
17
+  // eslint-disable-next-line react-hooks/rules-of-hooks
18
+  const [data, setData] = useState([{ visitRecords: [] }])
19
+  const [dataConsultant, setDataonsultant] = useState({})
20
+  const [intentionData, setIntentionData] = useState([])
21
+
22
+  // eslint-disable-next-line react-hooks/rules-of-hooks
23
+  useEffect(() => {
24
+    getById()
25
+  }, [])
26
+
27
+  // 查询
28
+  function getById(params) {
29
+    const { id } = props.location.query;
30
+    if (id === '' || id === undefined) {
31
+      return
32
+    }
33
+
34
+    request({ ...apis.customer.CustomerRecommendGet, urlData: { id }, params: { ...params } }).then(res => {
35
+      setData(res)
36
+      setDataonsultant(res.geoInfo)
37
+    })
38
+  }
39
+// 分页
40
+  const changePageNum = pageNumber => {
41
+    // getList({ pageNum: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
42
+  }
43
+  const columns = [
44
+    {
45
+      title: '访问事件',
46
+      dataIndex: 'activity',
47
+      key: 'activity',
48
+      align: 'center',
49
+    },
50
+    {
51
+      title: '访问时间',
52
+      dataIndex: 'visitTime',
53
+      key: 'visitTime',
54
+      align: 'center',
55
+
56
+    },
57
+    {
58
+      title: '停留时间',
59
+      dataIndex: 'visitDuration',
60
+      key: 'visitDuration',
61
+      align: 'center',
62
+      render: (_, record) => <span>{record.visitDuration === null ? 0 : record.visitDuration }秒</span>,
63
+    },
64
+  ]
65
+  // 意向
66
+  const intention = [
67
+    {
68
+      title: 'Name',
69
+      dataIndex: 'name',
70
+      width: 150,
71
+      render: (_, record) => <span>香颂半岛</span>,
72
+    },
73
+    {
74
+      title: 'Address',
75
+      dataIndex: 'address',
76
+      render: (_, record) => <span style={{ marginLeft: '55%' }}>22</span>,
77
+    },
78
+  ];
79
+
80
+for (let i = 0; i < 1; i++ ) {
81
+  intentionData.push({
82
+    key: i,
83
+    name: `Edward King ${i}`,
84
+    age: 32,
85
+    address: `London, Park Lane no. ${i}`,
86
+  });
87
+}
88
+  return (
89
+    <>
90
+      <div className={publicStyle.cardBox}>
91
+     {/* { console.log("data:",data),console.log("data:",dataConsultant)} */}
92
+        <div className={publicStyle.rightBox}>
93
+          <p className={publicStyle.tit}>客户信息</p>
94
+          <img className={publicStyle.touxiang} src={ data.picture && data.picture } />
95
+          <div className={publicStyle.right}>
96
+            <p className={publicStyle.rightItem}>用户名称:{ data.name }</p>
97
+            <p className={publicStyle.rightItem}>手机号码:{ data.phone }</p>
98
+            <p className={publicStyle.rightItem}>首次访问时间:{data.visitTime && moment(data.visitTime).format('YYYY-MM-DD')}</p>
99
+          </div>
100
+          <div className={publicStyle.Centered}>
101
+          <p>访问时长:{ data.duration }秒</p>
102
+          <p>访问次数:{ data.visitTimes }</p>
103
+          <p className={publicStyle.rightItem}>来访渠道:活动分享</p>
104
+          {/* <p>预约人数:{ data.visiteNum }</p> */}
105
+          </div>
106
+          {/* <p className={styles.rightItem}>预约到访时间:{data.appointmentTime && moment(data.appointmentTime).format('YYYY-MM-DD') }</p> */}
107
+          <div className={publicStyle.rightInfo}>
108
+            <p className={publicStyle.rightItem}>国家:{ dataConsultant && dataConsultant.country }</p>
109
+            <p className={publicStyle.rightItem}>省份:{ dataConsultant && dataConsultant.provience }</p>
110
+            <p className={publicStyle.rightItem}>城市:{dataConsultant && dataConsultant.city }</p>
111
+            {/* <p className={styles.rightItem}>详细信息:</p> */}
112
+            {/* <p className={styles.rightItem}>意向项目:{data.intention }</p> */} 
113
+            {/* <p className={styles.rightItem}>客户说明:{ data.verifyRemark }</p> */}
114
+          </div>
115
+        </div>
116
+        {/* { console.log("data:",data),console.log("data:",dataConsultant)} */}
117
+        <div className={publicStyle.leftBoxCentre}>
118
+          <div className={publicStyle.tit}>
119
+                <span>项目名称</span>
120
+                <span style={{ marginLeft: '47%' }}>项目名称</span>
121
+          </div>
122
+          {/* <img className={styles.touxiang} src={ data.picture && data.picture } /> */}
123
+          <div className={publicStyle.infoItem}>
124
+          <Table columnWidth={10} showHeader={false} columns={intention} dataSource={intentionData} pagination={{ pageSize: 50 }} scroll={{ y: 240 }}/>,
125
+          </div>
126
+        </div>
127
+      </div>
128
+      <div className={publicStyle.recordBox}>
129
+        <p className={publicStyle.tableName}>访问记录</p>
130
+        <Table dataSource={data.visitRecords} columns={columns} rowKey="customerDetail" onChange={changePageNum} showQuickJumper/>
131
+      </div>
132
+    </>
133
+  )
134
+}
135
+const WrappedHeader = Form.create({ name: 'header' })(header);
136
+
137
+export default WrappedHeader

+ 209
- 0
src/pages/customer/customerlist/publicStyle.less Прегледај датотеку

@@ -0,0 +1,209 @@
1
+.SubmitButton {
2
+  background: rgba(239,39,58,1);
3
+  border-radius: 7px;
4
+  border: 0px;
5
+}
6
+.text {
7
+  color: rgba(239,39,58,1);
8
+}
9
+.SelectFrom {
10
+  width: 180px;
11
+  background: #ffffff;
12
+  border-radius: 7px;
13
+  border: 1px solid #dbdbdb;
14
+}
15
+.addButton {
16
+  background: #50be00;
17
+  border-radius: 4px;
18
+  border: 0px;
19
+  margin: 10px 0px;
20
+}
21
+.cardText {
22
+  color: #333;
23
+  display: flex;
24
+  align-items: center;
25
+  position: relative;
26
+  line-height: 1.5;
27
+  font-size: 0.106rem;
28
+  margin-bottom: 0.08rem;
29
+
30
+}
31
+.cardItem{
32
+  color: #666;
33
+  display: flex;
34
+  align-items: center; 
35
+  line-height: 1.5;
36
+  font-size: 0.106rem;
37
+  margin-bottom: 0.08rem; 
38
+}
39
+.ediText {
40
+  font-size: 0.106rem;
41
+  color: #ff925c;
42
+  line-height: 24px;
43
+  position: absolute;
44
+  right: 0;
45
+}
46
+.title{
47
+  display: inline-block;
48
+  width:  0.54rem;
49
+  justify-content: space-between;
50
+  text-align: justify;
51
+  text-align-last:justify
52
+}
53
+
54
+.address { 
55
+  width: 400px;
56
+  height: 24px; 
57
+  text-overflow: ellipsis; 
58
+  white-space: nowrap;
59
+  overflow: hidden;
60
+}
61
+
62
+.pitchButton { 
63
+  border-color: rgba(255,126,72,1);
64
+  background-color: rgba(255,126,72,1);
65
+  color: rgba(255,255,255,1); 
66
+}
67
+.noButton {
68
+  border-color: rgba(255,126,72,1);
69
+  color: rgba(255,126,72,1);
70
+}
71
+.displayS {
72
+  display: none;
73
+}
74
+
75
+
76
+// 客户详情样式
77
+.cardBox{
78
+  display: flex;
79
+  .leftBox{
80
+    width:90%;
81
+    min-width:28.5%;
82
+    height:315px;
83
+    background:rgba(255,255,255,1);
84
+    box-shadow:0px 0px 16px 2px rgba(0,0,0,0.12);
85
+    border-radius:8px;
86
+    display: inline-block;
87
+    margin-right: 30px;
88
+    padding: 30px;
89
+    overflow: hidden;
90
+  }
91
+  .rightBox{
92
+    width:865px;
93
+    min-width:342px;
94
+    height:290px;
95
+    background:rgba(255,255,255,1);
96
+    box-shadow:0px 0px 16px 2px rgba(0,0,0,0.12);
97
+    border-radius:8px;
98
+    display: inline-block;
99
+    margin-right: 30px;
100
+    padding: 30px;
101
+    overflow: hidden;
102
+  }
103
+  .rightBox{
104
+    width:-webkit-fill-available;
105
+    height:315px;
106
+    min-width: 70%;
107
+    background:rgba(255,255,255,1);
108
+    box-shadow:0px 0px 16px 2px rgba(0,0,0,0.12);
109
+    border-radius:8px;
110
+    display: inline-block;
111
+    padding: 30px;
112
+    overflow: hidden;
113
+    position: relative;
114
+  }
115
+  .rightBoxCentre{
116
+    width:865px;
117
+    height:315px;
118
+    min-width: 60%;
119
+    background:rgba(255,255,255,1);
120
+    box-shadow:0px 0px 16px 2px rgba(0,0,0,0.12);
121
+    border-radius:8px;
122
+    display: inline-block;
123
+    padding: 30px;
124
+    overflow: hidden;
125
+    position: relative;
126
+  }
127
+  .leftBoxCentre{
128
+    width:100%;
129
+    height:315px;
130
+    background:rgba(255,255,255,1);
131
+    box-shadow:0px 0px 16px 2px rgba(0,0,0,0.12);
132
+    border-radius:8px;
133
+    display: inline-block;
134
+    padding: 30px;
135
+    overflow: hidden;
136
+    position: relative;
137
+  }
138
+  .tit{
139
+    font-size:24px;
140
+    font-weight:600;
141
+    color:#222;
142
+    margin: 10px 0 0 0;
143
+  }
144
+  .touxiang{
145
+    width: 120px;
146
+    width: 120px;
147
+    border-radius: 6px;
148
+    margin: 30px 0 20px 0;
149
+  }
150
+  .infoItem{
151
+    color:#666;
152
+    font-size: 19px;
153
+    margin: 0 0 10px 0;
154
+    
155
+  }
156
+  .rightItem{
157
+    color:#666;
158
+    font-size: 19px;
159
+    margin: 0 0 15px 0;
160
+  }
161
+  .right{
162
+    position: absolute;
163
+    top:108px;
164
+    left:170px;
165
+  }
166
+  .left{
167
+    position: absolute;
168
+    top:108px;
169
+    left:60%;
170
+  }
171
+  .rightInfo{
172
+    position: absolute;
173
+    top:108px;
174
+    left:80%;
175
+  }
176
+
177
+  .Centered{
178
+    position: absolute;
179
+    top:108px;
180
+    left:40%;
181
+    margin: 0 0 15px 0;
182
+    color:#666;
183
+    font-size: 19px;
184
+  }
185
+
186
+  .rightCentered{
187
+    position: absolute;
188
+    top:108px;
189
+    left:55%;
190
+    margin: 0 0 15px 0;
191
+    color:#666;
192
+    font-size: 19px;
193
+  }
194
+  
195
+}
196
+.recordBox{
197
+  width:100%;
198
+  background:rgba(255,255,255,1);
199
+  box-shadow:0px 0px 16px 2px rgba(0,0,0,0.12);
200
+  border-radius:8px;
201
+  margin-top: 30px;
202
+  padding: 30px;
203
+  .tableName{
204
+    font-size:24px;
205
+    font-weight:600;
206
+    color:#222;
207
+  }
208
+}
209
+

+ 64
- 6
src/pages/customer/customerlist/style.less Прегледај датотеку

@@ -77,9 +77,21 @@
77 77
 .cardBox{
78 78
   display: flex;
79 79
   .leftBox{
80
-    width:342px;
80
+    width:1000px;
81 81
     min-width:342px;
82
-    height:511px;
82
+    height:1000px;
83
+    background:rgba(255,255,255,1);
84
+    box-shadow:0px 0px 16px 2px rgba(0,0,0,0.12);
85
+    border-radius:8px;
86
+    display: inline-block;
87
+    margin-right: 30px;
88
+    padding: 30px;
89
+    overflow: hidden;
90
+  }
91
+  .rightBox{
92
+    width:865px;
93
+    min-width:342px;
94
+    height:290px;
83 95
     background:rgba(255,255,255,1);
84 96
     box-shadow:0px 0px 16px 2px rgba(0,0,0,0.12);
85 97
     border-radius:8px;
@@ -90,8 +102,31 @@
90 102
   }
91 103
   .rightBox{
92 104
     width:-webkit-fill-available;
93
-    height:511px;
94
-    min-width: 800px;
105
+    height:315px;
106
+    min-width: 100%;
107
+    background:rgba(255,255,255,1);
108
+    box-shadow:0px 0px 16px 2px rgba(0,0,0,0.12);
109
+    border-radius:8px;
110
+    display: inline-block;
111
+    padding: 30px;
112
+    overflow: hidden;
113
+    position: relative;
114
+  }
115
+  .rightBoxCentre{
116
+    width:865px;
117
+    height:315px;
118
+    min-width: 60%;
119
+    background:rgba(255,255,255,1);
120
+    box-shadow:0px 0px 16px 2px rgba(0,0,0,0.12);
121
+    border-radius:8px;
122
+    display: inline-block;
123
+    padding: 30px;
124
+    overflow: hidden;
125
+    position: relative;
126
+  }
127
+  .leftBoxCentre{
128
+    width:100%;
129
+    height:315px;
95 130
     background:rgba(255,255,255,1);
96 131
     box-shadow:0px 0px 16px 2px rgba(0,0,0,0.12);
97 132
     border-radius:8px;
@@ -128,10 +163,33 @@
128 163
     top:108px;
129 164
     left:170px;
130 165
   }
166
+  .left{
167
+    position: absolute;
168
+    top:108px;
169
+    left:60%;
170
+  }
131 171
   .rightInfo{
132 172
     position: absolute;
133
-    top:50px;
134
-    left:50%;
173
+    top:108px;
174
+    left:80%;
175
+  }
176
+
177
+  .Centered{
178
+    position: absolute;
179
+    top:108px;
180
+    left:30%;
181
+    margin: 0 0 15px 0;
182
+    color:#666;
183
+    font-size: 19px;
184
+  }
185
+
186
+  .rightCentered{
187
+    position: absolute;
188
+    top:108px;
189
+    left:55%;
190
+    margin: 0 0 15px 0;
191
+    color:#666;
192
+    font-size: 19px;
135 193
   }
136 194
   
137 195
 }

+ 7
- 5
src/pages/customer/independentList/index.jsx Прегледај датотеку

@@ -112,13 +112,15 @@ class ModalTable extends React.Component {
112 112
         title: '状态',
113 113
         // eslint-disable-next-line consistent-return
114 114
         render: (text, records) => {
115
-          if (records.status === 1) { return '报备' }
115
+          console.log("retrun", records)
116
+          if (records.status === 1) { if(records.reportRecommendStatus === 1) {return '报备'} if(records.reportRecommendStatus === 2) {return '推荐'}  }
116 117
           if (records.status === 2) { return '到访' }
117 118
           if (records.status === 3) { return '认购' }
118 119
           if (records.status === 4) { return '签约' }
119 120
           if (records.verifyStatus === 1) { return '待审核' }
120 121
           if (records.verifyStatus === 2) { return '审核同意' }
121 122
           if (records.verifyStatus === 3) { return '签约' }
123
+          // reportRecommendStatus
122 124
         },
123 125
       },
124 126
     ]
@@ -210,15 +212,15 @@ class InviteTable extends React.Component {
210 212
       },
211 213
       {
212 214
         title: '用户姓名',
213
-        dataIndex: 'name',
214
-        key: 'name',
215
+        dataIndex: 'nickname',
216
+        key: 'nickname',
215 217
         align: 'center',
216 218
         render: text => <a>{text}</a>,
217 219
       },
218 220
       {
219 221
         title: '电话',
220
-        dataIndex: 'tel',
221
-        key: 'tel',
222
+        dataIndex: 'phone',
223
+        key: 'phone',
222 224
         align: 'center',
223 225
       },
224 226
       {

+ 12
- 4
src/pages/customer/recommendCustomer/audit.jsx Прегледај датотеку

@@ -38,7 +38,7 @@ function body(props) {
38 38
   const { getFieldDecorator } = props.form
39 39
 
40 40
   // eslint-disable-next-line react-hooks/rules-of-hooks
41
-  const [visibleData, setVisibleData] = useState({ visible: false, customerId: '', realtyConsultant: '' })
41
+  const [visibleData, setVisibleData] = useState({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
42 42
 
43 43
   // eslint-disable-next-line react-hooks/rules-of-hooks
44 44
   const [dataSource, setDataSource] = useState({ picture: '' })
@@ -62,7 +62,7 @@ function body(props) {
62 62
 
63 63
   function submitDate(params) {
64 64
     // props.form.setFieldsValue(res)
65
-    request({ ...apis.customer.auto, urlData: { id: params.customerId || props.form.getFieldValue('customerId') }, params: { verifyStatus: params.verifyStatus } }).then(() => {
65
+    request({ ...apis.customer.auto, urlData: { id: params.customerId || props.form.getFieldValue('customerId') }, params: { verifyStatus: params.verifyStatus, realtyConsultant: props.form.getFieldValue('realtyConsultant') } }).then(() => {
66 66
       // eslint-disable-next-line no-unused-expressions
67 67
       openNotificationWithIcon('success', '操作成功')
68 68
       router.go(-1)
@@ -90,16 +90,17 @@ function body(props) {
90 90
 
91 91
   // 显示选择置业顾问的窗口
92 92
   function showConsultant() {
93
-    setVisibleData({ visible: true, customerId: props.form.getFieldValue('customerId'), realtyConsultant: props.form.getFieldValue('realtyConsultant') })
93
+    setVisibleData({ visible: true, customerId: props.form.getFieldValue('customerId'), realtyConsultant: props.form.getFieldValue('realtyConsultant'), buildingId: props.form.getFieldValue('buildingId') })
94 94
   }
95 95
 
96 96
   // 关闭选择置业顾问的窗口
97 97
   function closeConsultant() {
98
-    setVisibleData({ visible: false, customerId: '', realtyConsultant: '' })
98
+    setVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
99 99
   }
100 100
 
101 101
   // 选择置业顾问弹窗
102 102
   function consultantSuccess(e) {
103
+    console.log(e)
103 104
     props.form.setFieldsValue({ realtyConsultant: e.realtyConsultant, consultantName: e.name })
104 105
   }
105 106
 
@@ -113,6 +114,13 @@ function body(props) {
113 114
             />,
114 115
           )}
115 116
         </Form.Item>
117
+        <Form.Item label="项目ID" style={{ display: 'none' }}>
118
+          {getFieldDecorator('buildingId')(
119
+            <Input
120
+              placeholder="项目ID"
121
+            />,
122
+          )}
123
+        </Form.Item>
116 124
         <Form.Item label="归属人" style={{ display: 'none' }}>
117 125
           {getFieldDecorator('realtyConsultant')(
118 126
             <Input

+ 30
- 20
src/pages/customer/recommendCustomer/components/attribution.jsx Прегледај датотеку

@@ -21,18 +21,18 @@ class ModalAttribution extends React.Component {
21 21
     super(props);
22 22
     this.state = {
23 23
        dataSource: { records: [] },
24
-       visibleData: { visible: false, customerId: '', realtyConsultant: '' },
24
+       visibleData: { visible: false, customerId: '', realtyConsultant: '', buildingId: '' },
25 25
     }
26 26
   }
27 27
 
28 28
   // 挂载之后
29 29
   componentDidMount() {
30
-    this.getList({ pageNumber: 1, pageSize: 5 })
30
+    // this.getList({ pageNumber: 1, pageSize: 5 })
31 31
   }
32 32
 
33 33
   componentDidUpdate(preProps, preState) {
34 34
     if (this.props.visibleData.visible !== preState.visibleData.visible) {
35
-      this.getList({ pageNumber: 1, pageSize: 5 })
35
+      this.getList({ pageNumber: 1, pageSize: 5, buildingId: this.props.visibleData.buildingId })
36 36
       this.setState({ visibleData: this.props.visibleData });
37 37
     }
38 38
   }
@@ -49,8 +49,12 @@ class ModalAttribution extends React.Component {
49 49
   }
50 50
 
51 51
   getList(params) {
52
+    if (params.buildingId === '' || params.buildingId === null || params.buildingId === undefined) {
53
+      return
54
+    }
55
+
52 56
     // 网路请求
53
-    request({ ...apis.customer.consultant, params: { ...params } }).then(res => {
57
+    request({ ...apis.customer.buildingConsultant, params: { ...params } }).then(res => {
54 58
       this.setState({ dataSource: res })
55 59
     }).catch(err => {
56 60
       // eslint-disable-next-line no-unused-expressions
@@ -68,21 +72,27 @@ class ModalAttribution extends React.Component {
68 72
 
69 73
    // 分页
70 74
   onChange(pageNum) {
71
-    this.getList({ pageNumber: pageNum, pageSize: 5 })
75
+    this.getList({ pageNumber: pageNum, pageSize: 5, buildingId: this.props.visibleData.buildingId })
72 76
   }
73 77
 
74 78
   // 提交
75 79
   submitGm(record) {
76
-    // 网路请求
77
-    request({ ...apis.customer.recommendEdit, urlData: { id: this.state.visibleData.customerId }, data: { customerId: this.state.visibleData.customerId, realtyConsultant: record.personId } }).then(res => {
78
-      // eslint-disable-next-line no-unused-expressions
79
-      this.openNotificationWithIcon('success', '操作成功')
80
-      this.handleCancel()
81
-      this.props.onSuccess({ realtyConsultant: record.personId, name: record.name })
82
-    }).catch(err => {
83
-      // eslint-disable-next-line no-unused-expressions
84
-      // this.openNotificationWithIcon('error', err)
85
-    })
80
+
81
+    console.log('传递之前:', record)
82
+    this.handleCancel()
83
+    this.props.onSuccess({ realtyConsultant: record.userId, name: record.userName })
84
+
85
+
86
+    // // 网路请求
87
+    // request({ ...apis.customer.recommendEdit, urlData: { id: this.state.visibleData.customerId }, data: { customerId: this.state.visibleData.customerId, realtyConsultant: record.personId } }).then(res => {
88
+    //   // eslint-disable-next-line no-unused-expressions
89
+    //   this.openNotificationWithIcon('success', '操作成功')
90
+    //   this.handleCancel()
91
+    //   this.props.onSuccess({ realtyConsultant: record.personId, name: record.name })
92
+    // }).catch(err => {
93
+    //   // eslint-disable-next-line no-unused-expressions
94
+    //   // this.openNotificationWithIcon('error', err)
95
+    // })
86 96
   }
87 97
 
88 98
   render() {
@@ -94,8 +104,8 @@ class ModalAttribution extends React.Component {
94 104
       // },
95 105
       {
96 106
         title: '姓名',
97
-        dataIndex: 'name',
98
-        key: 'name',
107
+        dataIndex: 'userName',
108
+        key: 'userName',
99 109
       },
100 110
       {
101 111
         title: '电话',
@@ -109,15 +119,15 @@ class ModalAttribution extends React.Component {
109 119
       },
110 120
       {
111 121
         title: '岗位',
112
-        dataIndex: 'post',
113
-        key: 'post',
122
+        dataIndex: 'position',
123
+        key: 'position',
114 124
       },
115 125
       {
116 126
         title: '操作',
117 127
         dataIndex: 'personId',
118 128
         key: 'personId',
119 129
         // eslint-disable-next-line no-nested-ternary
120
-        render: (_, record) => <>{ this.props.visibleData.realtyConsultant !== record.personId && <Button type="danger" onClick={() => this.submitGm(record)}>确定</Button>}</>,
130
+        render: (_, record) => <>{ this.props.visibleData.realtyConsultant !== record.userId && <Button type="danger" onClick={() => this.submitGm(record)}>确定</Button>}</>,
121 131
       },
122 132
     ]
123 133
     return (

+ 4
- 3
src/pages/customer/report/index.jsx Прегледај датотеку

@@ -75,10 +75,11 @@ function body(props) {
75 75
     */
76 76
   function handleReset() {
77 77
     props.form.resetFields();
78
+    getList({ pageNumber: 1, pageSize: 9 })
78 79
   }
79 80
 
80 81
   function exportReport() {
81
-    request({ ...apis.customer.customerRecommendReportExport, responseType: 'blob' })
82
+    request({ ...apis.customer.customerRecommendReportExport, params: { ...props.form.getFieldsValue() }, responseType: 'blob' })
82 83
       .then(response => {
83 84
         download(response)
84 85
       })
@@ -123,8 +124,8 @@ function body(props) {
123 124
     },
124 125
     {
125 126
       title: '意向项目',
126
-      dataIndex: 'intention',
127
-      key: 'intention',
127
+      dataIndex: 'intentionName',
128
+      key: 'intentionName',
128 129
     },
129 130
     {
130 131
       title: '置业顾问',

+ 1
- 1
src/pages/indexEcharts/components/UserBehavior.jsx Прегледај датотеку

@@ -272,7 +272,7 @@ const UserBehavior = props => {
272 272
           {!props.BuildSelectHide && <span style={{ fontSize: '0.09rem', color: '#888', marginLeft: '0.06rem' }}>最近七天</span>}
273 273
         </p>
274 274
         <div style={{ float: 'right', marginTop: '-40px', marginBottom: '20px' }}>
275
-          {!props.BuildSelectHide && <BuildSelect slot="action" onChange={(e => handleBuildingChange(e))} checkFirst></BuildSelect>}
275
+          {!props.BuildSelectHide && <BuildSelect slot="action" onChange={(e => handleBuildingChange(e))}></BuildSelect>}
276 276
         </div>
277 277
         <EChart options={options} style={style} />
278 278
         {props.tableShow &&

+ 107
- 74
src/pages/indexEcharts/userBehavior.jsx Прегледај датотеку

@@ -1,12 +1,13 @@
1 1
 import React, { Component, useState, useEffect } from 'react';
2
-import { Radio, DatePicker, Form, Input, Button, Icon, Select, message, Table } from 'antd';
3
-import { Row, Col, Menu, Dropdown } from 'antd';
4
-import UserBehavior from './components/UserBehavior'
2
+import { Radio, DatePicker, Form, Input, Button, Icon, Select, message, Table , Row, Col, Menu, Dropdown } from 'antd';
3
+
5 4
 import moment from 'moment';
5
+import UserBehavior from './components/UserBehavior'
6 6
 import EChart from '../../components/EchartsTest/EChart';
7 7
 import request from '../../utils/request';
8 8
 import apis from '../../services/apis';
9 9
 import BuildSelect from '../../components/SelectButton/BuildSelect'
10
+import { func } from 'prop-types';
10 11
 
11 12
 // const formatDate = (start, end) => {
12 13
 //   const startDate = moment(start).format('YYYY-MM-DDT00:00:00.000') + 'Z'
@@ -16,77 +17,73 @@ import BuildSelect from '../../components/SelectButton/BuildSelect'
16 17
 const { Option } = Select;
17 18
 
18 19
 const header = props => {
19
-
20
+  // eslint-disable-next-line react-hooks/rules-of-hooks
20 21
   const [tableData, setTableData] = useState({ records: [] })
21 22
 
23
+  // eslint-disable-next-line react-hooks/rules-of-hooks
22 24
   const [endDate, setEndDate] = useState({})
25
+  // eslint-disable-next-line react-hooks/rules-of-hooks
23 26
   const [startDate, setStartDate] = useState({})
24
-  let daterange = []
27
+  const daterange = []
25 28
 
29
+  // eslint-disable-next-line react-hooks/rules-of-hooks
26 30
   useEffect(() => {
27
-
31
+    window.scrollTo(0, 0)
28 32
     setEndDate(new Date())
29 33
     setStartDate(moment().subtract(7, 'day').toDate())
30 34
     getBizEventType()
31 35
     getBizEventList()
32 36
     getProperties()
33
-  
34
-    
37
+    props.form.setFieldsValue({ radioGroup: 'a' })
35 38
   }, [])
36
- 
39
+
40
+  // eslint-disable-next-line react-hooks/rules-of-hooks
37 41
   const [eventypes, setEventTypes] = useState([])
38 42
   function getBizEventType(row) {
39
-
40 43
     request({
41 44
       ...apis.indexEcharts.bizEvent.dict,
42
-    }).then((data) => {
43
-      setEventTypes(data.records)
44
-
45
+    }).then(data => {
46
+      const eventType = ['agent', 'main']
47
+      setEventTypes(data.records.filter(item => !eventType.includes(item.typeId)))
45 48
     })
46 49
   }
47 50
   const [eventList, setEventList] = useState([])
48 51
   function getBizEventList(row) {
49
-
50 52
     request({
51 53
       ...apis.indexEcharts.bizEvent.list,
52
-    }).then((data) => {
54
+    }).then(data => {
53 55
       setEventList(data.records)
54
-      
55 56
     })
56 57
   }
57 58
   const [properties, setProperties] = useState([])
58 59
   function getProperties(row) {
59
-
60 60
     request({
61 61
       ...apis.indexEcharts.bizEvent.properties,
62
-    }).then((data) => {
63
-
62
+    }).then(data => {
64 63
       setProperties(data.records)
65
-
66 64
     })
67 65
   }
68 66
 
69 67
   const { RangePicker } = DatePicker;
70 68
 
71
-  function onChangetime(dates, dateStrings) {
72
-
73
-    daterange[1] = dateStrings[1]
74
-    daterange[0] = dateStrings[0]
75 69
 
70
+  function handleSubmit(e) {
71
+    e.preventDefault();
72
+    props.form.validateFields((err, values) => {
73
+      if (!err) {
74
+        const { rangePicker } = values
75
+        console.log('Received values of form: ', values.rangePicker);
76
+        setEndDate(rangePicker[1])
77
+        setStartDate(rangePicker[0])
78
+      }
79
+    });
76 80
   }
77 81
 
78
-  const getDataOf = (days) => () => {
79
-
82
+  const getDataOf = days => () => {
80 83
     setEndDate(new Date())
81 84
     setStartDate(moment().subtract(days, 'day').toDate())
82 85
   }
83 86
 
84
-  function datalist() {
85
-
86
-    setEndDate(daterange[1])
87
-    setStartDate(daterange[0])
88
-
89
-  }
90 87
 
91 88
   function redata(e) {
92 89
     console.log('行为回调数据:', e)
@@ -109,6 +106,12 @@ const header = props => {
109 106
     setBuildingId(value)
110 107
   }
111 108
 
109
+  // 重置
110
+  function resetQuery() {
111
+    props.form.resetFields()
112
+    props.form.setFieldsValue({ radioGroup: 'a' })
113
+  }
114
+
112 115
   const columns = [
113 116
     {
114 117
       title: '访问事件',
@@ -144,52 +147,80 @@ const header = props => {
144 147
 
145 148
   const dataSource = []
146 149
 
147
-  return (<>
150
+  const { getFieldDecorator, getFieldsError, getFieldError, isFieldTouched } = props.form;
151
+  return (
152
+  <>
148 153
     <div>
149 154
       <div>
150
-        <Radio.Group buttonStyle="solid" defaultValue="a">
151
-          <Radio.Button value="a" onClick={getDataOf(7)}>最近7天</Radio.Button>
152
-          <Radio.Button value="b" onClick={getDataOf(30)}>最近1月</Radio.Button>
153
-        </Radio.Group>
154
-        <RangePicker
155
-          style={{ paddingLeft: '30px', width: '400px' }}
156
-          ranges={{
157
-            Today: [moment(), moment()],
158
-            'This Month': [moment().startOf('month'), moment().endOf('month')],
159
-          }}
160
-          // defaultValue={[moment(new Date(new Date().setDate((new Date().getDate() - 6))), 'YYYY-MM-DD HH:MM:SS'), moment(new Date(), 'YYYY-MM-DD HH:MM:SS')]}
161
-          showTime
162
-          onChange={onChangetime}
163
-        />
164
-        <Button type="primary" htmlType="submit" style={{ marginLeft: '30px', float: 'right' }} onClick={datalist}>
165
-          搜索
166
-      </Button>
167
-      </div>
168
-
169
-      <div style={{ display: 'flex', margin: '24px 0' }}>
170
-        <BuildSelect style={{ width: '14%', minWidth: '160px' }} slot='action' onChange={(e => handleBuildingChange(e))}></BuildSelect>
171
-       
172
-        <Select style={{ width: '14%', minWidth: '160px', marginLeft: '2%' }} placeholder="所有事件组" onChange={handleChangeType}>
173
-          {eventypes.map(type => (
174
-            <Option key={type.typeId}>{type.typeName}</Option>
175
-          ))}
176
-      </Select>
177
-        <Select style={{ width: '14%', minWidth: '200px', marginLeft: '2%' }} placeholder="请选择事件" onChange={handleChangeEvent}>
178
-          {eventList.map(event => (
179
-            <Option key={event.eventId}>{event.eventName}</Option>
180
-          ))}
181
-      </Select>
182
-        <Select style={{ width: '14%', minWidth: '160px', marginLeft: '2%' }} placeholder="请选择属性" onChange={handleChangeProperty}>
183
-          {properties.map(property => (
184
-            <Option key={property.propertyId}>{property.propertyName}</Option>
185
-          ))}
186
-      </Select>
187
-     
155
+        <Form layout="inline" onSubmit={handleSubmit}>
156
+          <Form.Item>
157
+            {getFieldDecorator('radioGroup')(
158
+              <Radio.Group buttonStyle="solid">
159
+                <Radio.Button value="a" onClick={getDataOf(7)}>最近7天</Radio.Button>
160
+                <Radio.Button value="b" onClick={getDataOf(30)}>最近1月</Radio.Button>
161
+              </Radio.Group>,
162
+            )}
163
+          </Form.Item>
164
+          <Form.Item>
165
+            {getFieldDecorator('rangePicker')(
166
+              <RangePicker
167
+                style={{ paddingLeft: '30px', width: '400px' }}
168
+                ranges={{
169
+                  Today: [moment(), moment()],
170
+                  'This Month': [moment().startOf('month'), moment().endOf('month')],
171
+                }}
172
+                // defaultValue={[moment(new Date(new Date().setDate((new Date().getDate() - 6))), 'YYYY-MM-DD HH:MM:SS'), moment(new Date(), 'YYYY-MM-DD HH:MM:SS')]}
173
+                showTime
174
+              />,
175
+            )}
176
+          </Form.Item>
177
+
178
+            <Button type="primary" htmlType="submit" style={{ marginLeft: '30px', float: 'right' }}>
179
+              搜索
180
+            </Button>
181
+            <Button style={{ marginLeft: '30px', float: 'right' }} onClick={resetQuery}>
182
+              重置
183
+            </Button>
184
+
185
+          <div style={{ display: 'flex', margin: '24px 0' }}>
186
+            <Form.Item>
187
+              {getFieldDecorator('buildingId')(
188
+                <BuildSelect style={{ width: '14%', minWidth: '160px' }} slot="action" onChange={(e => handleBuildingChange(e))}></BuildSelect>,
189
+              )}
190
+            </Form.Item>
191
+            <Form.Item>
192
+              {getFieldDecorator('handleType')(
193
+                <Select style={{ width: '14%', minWidth: '160px', marginLeft: '2%' }} placeholder="所有事件组" onChange={handleChangeType}>
194
+                    {eventypes.map(type => (
195
+                      <Option key={type.typeId}>{type.typeName}</Option>
196
+                    ))}
197
+                </Select>,
198
+              )}
199
+            </Form.Item>
200
+            <Form.Item>
201
+              {getFieldDecorator('handleEvent')(
202
+                 <Select style={{ width: '14%', minWidth: '200px', marginLeft: '2%' }} placeholder="请选择事件" onChange={handleChangeEvent}>
203
+                      {eventList.map(event => (
204
+                        <Option key={event.eventId}>{event.eventName}</Option>
205
+                      ))}
206
+                  </Select>,
207
+              )}
208
+            </Form.Item>
209
+            <Form.Item>
210
+              {getFieldDecorator('handleProperty')(
211
+                 <Select style={{ width: '14%', minWidth: '160px', marginLeft: '2%' }} placeholder="请选择属性" onChange={handleChangeProperty}>
212
+                    {properties.map(property => (
213
+                      <Option key={property.propertyId}>{property.propertyName}</Option>
214
+                    ))}
215
+                </Select>,
216
+              )}
217
+            </Form.Item>
218
+          </div>
219
+        </Form>
188 220
       </div>
189 221
 
190
-
191 222
       <div style={{ margin: '24px 0' }}>
192
-        <UserBehavior tableShow={true} BuildSelectHide={true} buildingId={buildingId} endDate={endDate} startDate={startDate}  eventType={eventType} activity={activity}  event={event} dataZoom={true} onReData={(e) => redata(e)}></UserBehavior>
223
+       <UserBehavior tableShow BuildSelectHide buildingId={buildingId} endDate={endDate} startDate={startDate} eventType={eventType} activity={activity} event={event} dataZoom onReData={e => redata(e)}></UserBehavior>
193 224
       </div>
194 225
 
195 226
       {/* <Table dataSource={dataSource} columns={columns} pagination={false} scroll={{ y: 500 }} /> */}
@@ -197,4 +228,6 @@ const header = props => {
197 228
   </>
198 229
   )
199 230
 }
200
-export default header
231
+
232
+const WrappedHorizontalLoginForm = Form.create({ name: 'header' })(header);
233
+export default WrappedHorizontalLoginForm

+ 5
- 1
src/pages/indexEcharts/userSource.jsx Прегледај датотеку

@@ -96,7 +96,11 @@ class Header extends React.Component {
96 96
   }
97 97
 
98 98
   datalist = () => {
99
-    this.setState({ endDate: daterange[1], startDate: daterange[0] })
99
+    console.log()
100
+    this.setState({ 
101
+      endDate: daterange[1] === '' ? new Date() : daterange[1],
102
+      startDate: daterange[0] === '' ? moment().subtract(7, 'day').toDate() : daterange[0],
103
+    })
100 104
   }
101 105
 
102 106
   onSuccess = e => {

+ 14
- 14
src/pages/integralMall/achieve.jsx Прегледај датотеку

@@ -132,25 +132,25 @@ const columns = [
132 132
             <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current}/>
133 133
           </div>
134 134
         </TabPane>
135
-        <TabPane tab="项目积分" key="project">
136
-        <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
137
-            <Form.Item>
138
-              {getFieldDecorator('buildingId')(
139
-                <BuildSelect />,
140
-              )}
141
-            </Form.Item>
142
-             
143
-            <Form.Item>
144
-              <Button type="primary" htmlType="submit" className={styles.searchBtn}>
145
-                搜索
146
-              </Button>
147
-            </Form.Item>
135
+        {/* <TabPane tab="项目积分" key="project">
136
+          <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
137
+              <Form.Item>
138
+                {getFieldDecorator('buildingId')(
139
+                  <BuildSelect />,
140
+                )}
141
+              </Form.Item>
142
+              
143
+              <Form.Item>
144
+                <Button type="primary" htmlType="submit" className={styles.searchBtn}>
145
+                  搜索
146
+                </Button>
147
+              </Form.Item>
148 148
           </Form>
149 149
           <Table rowKey="achie" style={{ marginTop: '40px' }} dataSource={data.records} columns={columns} pagination={false}/>
150 150
           <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
151 151
             <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current}/>
152 152
           </div>
153
-        </TabPane>
153
+        </TabPane> */}
154 154
       </Tabs>,
155 155
     </>
156 156
   )

+ 9
- 2
src/pages/integralMall/editGoods.jsx Прегледај датотеку

@@ -40,11 +40,18 @@ const header = props => {
40 40
       ]
41 41
     },
42 42
     {
43
-      label: '商品图',
43
+      label: '商品封面图',
44 44
       name: 'imgUrl',
45 45
       type: FieldTypes.ImageUploader,
46 46
       value: goodsData.imgUrl,
47
-      help: '建议图片尺寸:164px*164px',
47
+      help: '建议图片尺寸:320*320px,比例1:1,格式:jpg,用于商品封面图',
48
+    },
49
+    {
50
+      label: '商品主图',
51
+      name: 'detailImgUrl',
52
+      type: FieldTypes.ImageUploader,
53
+      value: goodsData.detailImgUrl,
54
+      help: '建议图片尺寸:750*750px,比例1:1,格式:jpg,用于商品主图',
48 55
     },
49 56
     {
50 57
       label: '商品名称',

+ 2
- 2
src/pages/integralMall/writeOff.jsx Прегледај датотеку

@@ -108,7 +108,7 @@ function header(props) {
108 108
   return (
109 109
     <>
110 110
       <Tabs onChange={callback} type="card">
111
-        <TabPane tab="扫码核销" key="1">
111
+        {/* <TabPane tab="扫码核销" key="1">
112 112
           <Row>
113 113
             <Col span={8} style={{ textAlign: 'center' }}>
114 114
               <img src={erweima} style={{ width: '50px', height: '50px', margin: '30px auto' }} />
@@ -129,7 +129,7 @@ function header(props) {
129 129
             </Col>
130 130
           </Row>
131 131
           <Dialog onEnter={handleEnter} onChange={changeCode} />
132
-        </TabPane>
132
+        </TabPane> */}
133 133
         <TabPane tab="手机号核销" key="2">
134 134
           <Row>
135 135
             <Col span={12} style={{ textAlign: 'center' }}>

+ 6
- 4
src/pages/news/list/editNewsList.jsx Прегледај датотеку

@@ -64,11 +64,11 @@ const { TextArea } = Input;
64 64
         ]
65 65
       },
66 66
       {
67
-        label: '资讯图片',
67
+        label: '资讯列表',
68 68
         name: 'newsImg',
69 69
         type: FieldTypes.ImageUploader,
70 70
         value: dynamicData.newsImg,
71
-        help: '建议图片尺寸:660px*416px',
71
+        help: '建议图片尺寸:320*256px,比例5:4,格式:jpg,用于资讯列表',
72 72
       },
73 73
       {
74 74
         label: '资讯标题',
@@ -215,9 +215,10 @@ const { TextArea } = Input;
215 215
 
216 216
         <div >
217 217
           <div style={{ display: 'flex', width: '100%', margin: '60px 0' }}>
218
-            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报图</p>
218
+            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>资讯海报图</p>
219 219
             <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
220 220
           </div>
221
+          <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于资讯海报</p>
221 222
           <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
222 223
             <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
223 224
             <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
@@ -290,9 +291,10 @@ const { TextArea } = Input;
290 291
         <Input placeholder="请输入分享标题" value={inputValue} onChange={e => changeInput(e.target.value)} />
291 292
       </div>
292 293
       <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
293
-        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享图</p>
294
+        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>资讯分享好友图</p>
294 295
         <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
295 296
       </div>
297
+      <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginTop: '20px' }}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于资讯分享好友</p>
296 298
       <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
297 299
       <Button onClick={() => router.go(-1)}>取消</Button>
298 300
     </div>

+ 18
- 18
src/pages/staff/list/editStaff.jsx Прегледај датотеку

@@ -158,22 +158,22 @@ const Edit = (props) => {
158 158
       </Select>,
159 159
       value: userData.roleIds,
160 160
     },
161
-    {
162
-      label: '标签',
163
-      name: 'taTags',
164
-      render: <Select
165
-        mode="multiple"
166
-        style={{ width: '100%' }}
167
-        placeholder="请选择标签"
168
-        onChange={tagsChange} >
169
-        {tagData.map(item => (
170
-          <Select.Option key={item.tagId} value={item.tagId}>
171
-            {item.tagName}
172
-          </Select.Option>
173
-        ))}
174
-      </Select>,
175
-      value: userData.taTags,
176
-    },
161
+    // {
162
+    //   label: '标签',
163
+    //   name: 'taTags',
164
+    //   render: <Select
165
+    //     mode="multiple"
166
+    //     style={{ width: '100%' }}
167
+    //     placeholder="请选择标签"
168
+    //     onChange={tagsChange} >
169
+    //     {tagData.map(item => (
170
+    //       <Select.Option key={item.tagId} value={item.tagId}>
171
+    //         {item.tagName}
172
+    //       </Select.Option>
173
+    //     ))}
174
+    //   </Select>,
175
+    //   value: userData.taTags,
176
+    // },
177 177
     {
178 178
       label: '地址',
179 179
       name: 'address',
@@ -191,10 +191,10 @@ const Edit = (props) => {
191 191
       value: userData.buildingId
192 192
     },
193 193
     {
194
-      label: '头像',
194
+      label: '置业顾问头像',
195 195
       name: 'photo',
196 196
       type: FieldTypes.ImageUploader,
197
-      extra: '建议图片大小 640 * 640',
197
+      extra: '建议图片尺寸:320*320px,比例1:1,格式:jpg,用于置业顾问头像',
198 198
       value: userData.photo,
199 199
       rules: [
200 200
         { required: true, message: '请选择头像' },

+ 10
- 5
src/pages/style/GoodsList.less Прегледај датотеку

@@ -8,16 +8,21 @@
8 8
   width: 93px;
9 9
   height: 93px;
10 10
 }
11
+
11 12
 .ant-table-column-title {
12 13
   font-weight: 600;
13 14
 }
14
-.shoppingCart{
15
-  color: #dcdcdc;
15
+
16
+.shoppingCart {
17
+  // color: #dcdcdc;
18
+  color: #bebebe;
16 19
   margin-left: 6px;
17 20
   font-size: 16px;
18 21
 }
19
-.edit{
20
-  color: #dcdcdc;
22
+
23
+.edit {
24
+  // color: #dcdcdc;
25
+  color: #bebebe;
21 26
   margin-left: 6px;
22 27
   font-size: 15px;
23
-}
28
+}

+ 164
- 46
src/pages/system/document/audit.jsx Прегледај датотеку

@@ -1,92 +1,210 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Col, Row, Button, Modal } from 'antd'
2
+import { Col, Row, Button, Modal, Input, Pagination, message } from 'antd'
3 3
 import ZmageImg from '../../../components/ZmageImg/ZmageImg'
4 4
 import request from '../../../utils/request';
5 5
 import apis from '../../../services/apis';
6 6
 import { router } from 'umi';
7 7
 import AuthButton from '../../../components/AuthButton';
8
+import moment from 'moment';
9
+
10
+const unaudited = {
11
+  // color :'rgb(255, 126, 72)'
12
+  float: "right", fontWeight: "bold", marginRight: '30px'
13
+}
14
+
15
+const auditPass = {
16
+  // color : '#FF7E48',
17
+  color: 'green',
18
+  float: "right", fontWeight: "bold", marginRight: '30px'
19
+}
20
+
21
+const noauditPass = {
22
+  color: ' #fc515c',
23
+  float: "right", fontWeight: "bold", marginRight: '30px'
24
+}
8 25
 
9 26
 function body (props) {
10 27
   const documentVerifyId = props.location.query.id
11 28
   const [data, setData] = useState([])
12
-
29
+  const [datas, setDatas] = useState({})
30
+  // const [status,setStatus] = useState()
13 31
   useEffect(() => {
14 32
     getList()
15
-
33
+    // setVisible(false)
34
+    // setReasonValue()
35
+    // useState(2)
16 36
   }, [])
17 37
   // , documentVerifyId: documentVerifyId
18 38
   function getList (params) {
19 39
     // 网路请求
20 40
     console.log(props, '1111')
21
-    request({ ...apis.system.documentVerifyDetail, urlData: { id: documentVerifyId } }).then(data => {
22
-      console.log('data:', data)
23
-      setData(data.imgList)
41
+    request({ ...apis.system.documentVerifyDetail, urlData: { id: documentVerifyId }, params: params }).then(data => {
42
+      console.log('data:', data.records)
43
+      setDatas(data)
44
+      setData(data.records)
24 45
     }).catch(err => {
25 46
       // eslint-disable-next-line no-unused-expressions
26 47
 
27 48
     })
28 49
   }
29 50
 
30
-  function onVerify (params) {
31
-    // 网路请求
32
-    request({ ...apis.system.updateVerify, urlData: { id: documentVerifyId }, data: { verifyStatus: params } }).then(data => {
33 51
 
34
-    }).catch(err => {
35
-      // eslint-disable-next-line no-unused-expressions
36 52
 
37
-    })
53
+  const cancelPage = () => {
54
+    router.push({
55
+      pathname: '/system/document/list',
56
+    });
38 57
   }
39 58
 
40 59
 
60
+  const Card = (props) => {
61
+    const [visible, setVisible] = useState()
62
+    const [reasonValue, setReasonValue] = useState('')
63
+    useEffect(() => {
64
+      setVisible(false)
65
+    }, [])
66
+
67
+
68
+    function onVerify (params) {
69
+      // 网路请求
70
+      console.log(reasonValue, "111212")
71
+      request({ ...apis.system.updateVerify, urlData: { id: props.data.documentVerifyId }, data: { verifyStatus: params, rejectReason: reasonValue } }).then(data => {
72
+        console.log(data, "datadata")
73
+        getList()
74
+      }).catch(err => {
41 75
 
42
-  const handleOk = () => {
43 76
 
77
+      })
78
+    }
44 79
 
45
-    Modal.confirm({
46
-      title: '审核通过后,将给当前用户发放积分 确认审核通过?',
47
-      okText: '确认',
48
-      cancelText: '取消',
49
-      onOk () {
50 80
 
51
-        onVerify(1)
81
+
82
+    const handleOk = (data) => {
83
+
84
+      if (data == 1) {
85
+        Modal.confirm({
86
+          title: '审核通过后,将给当前用户发放积分 确认审核通过?',
87
+          okText: '确认',
88
+          cancelText: '取消',
89
+          onOk () {
90
+
91
+            onVerify(1)
92
+          }
93
+        });
94
+      } else {
95
+        setVisible(true)
52 96
       }
53
-    });
97
+    }
98
+
99
+    const showModal = () => {
100
+      setVisible(true)
101
+    };
102
+
103
+    const handleOk1 = e => {
104
+      console.log(reasonValue, "2222");
105
+      if (reasonValue ) {
106
+        // console.log(e);
107
+        onVerify(2)
108
+        console.log(reasonValue, "11111111");
109
+        setVisible(false)
110
+      } else {
111
+        message.info("不能为空")
112
+      }
113
+
114
+    };
115
+
116
+    const handleCancel = e => {
117
+
118
+      setVisible(false)
119
+    };
120
+
121
+    const Reason = e => {
122
+      console.log(e.target.value)
123
+      // e.target.
124
+      setReasonValue(e.target.value)
125
+    }
126
+
127
+
128
+    // console.log("props", props.data)
129
+    const carddata = props.data.imgList
130
+    return (
131
+      <>
132
+        <div style={{ background: '#ffffff', padding: '40px', marginTop: '30px', borderRadius: '12px', boxShadow: '0px 0px 16px 2px rgba(0,0,0,0.12)' }}>
133
+          <p style={{ fontSize: '0.096rem' }}>
134
+            <span>资料说明:{props.data.documentTitle} </span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
135
+           
136
+            <span style={props.data.verifyStatus == 0 ? unaudited : props.data.verifyStatus == 1 ? auditPass : noauditPass} >
137
+              {props.data.verifyStatus == 0 ? "待审核" : props.data.verifyStatus == 1 ? "审核通过" : "不通过"}
138
+            </span>
139
+          </p>
140
+          <p style={{ fontSize: '0.096rem' }}>提交时间:{moment(props.data.createDate).format('YYYY-MM-DD HH:mm:ss')}   </p>
141
+
142
+          <div style={{ fontSize: '0.096rem' }}>资料图片:
143
+        <Row gutter={16}>
144
+              {
145
+                // data.consultant && data.consultant.projects.map((item, _) => <span>{item}</span>)
146
+                carddata.map((data, inx) =>
147
+                  <Col span={4} style={{ textAlign: "center" }}>
148
+                    <ZmageImg style={{ width: '128px', height: '128px', marginTop: '30px' }} src={data.img} />
149
+                  </Col>
150
+                )
151
+              }
152
+            </Row>
153
+          </div>
154
+          {props.data.verifyStatus == 0 && <div style={{ marginTop: '10px', display: 'flex', justifyContent: 'center' }}>
155
+            <AuthButton name="admin.documentVerify.id.put" noRight={null}>
156
+              <Button type="primary" style={{ marginTop: '30px' }} onClick={() => handleOk(1)}>通过</Button>
157
+            </AuthButton>
158
+            &nbsp;&nbsp;&nbsp;&nbsp;
159
+        <AuthButton name="admin.documentVerify.id.put" noRight={null}>
160
+              <Button style={{ marginTop: '30px' }} onClick={() => handleOk(2)}>不通过</Button>
161
+            </AuthButton>
162
+          </div>}
163
+
164
+          {props.data.verifyStatus == 2 &&  <p style={{ fontSize: '0.096rem',marginTop: '30px' }}>驳回原因:{props.data.rejectReason}   </p>}
165
+
166
+          <Modal
167
+            title="驳回原因"
168
+            visible={visible}
169
+            onOk={handleOk1}
170
+            onCancel={handleCancel}
171
+            okText="确认"
172
+            cancelText="取消"
173
+          >
174
+            <Input value={reasonValue} onChange={e => Reason(e)} />
175
+          </Modal>
176
+        </div>
177
+
178
+      </>
179
+    )
180
+    // return <div>111</div>
54 181
   }
55 182
 
56
-  const cancelPage = () => {
57
-    router.push({
58
-      pathname: '/system/document/list',
59
-    });
183
+  const changePageNum = (pageNumber) => {
184
+    getList({ pageNum: pageNumber, pageSize: 5 })
60 185
   }
61 186
 
187
+
62 188
   return (
63 189
     <>
64
-      <div style={{ background: '#ECECEC', padding: '30px' }}>
65
-        <Row gutter={16}>
66
-          {
67
-            // data.consultant && data.consultant.projects.map((item, _) => <span>{item}</span>)
68
-            data.map((data, inx) =>
69
-              <Col span={6}>
70
-                <ZmageImg style={{ width: '300px', height: '400px' }} src={data.img} />
71
-              </Col>
72
-            )
73
-          }
74
-        </Row>
75
-      </div>
76
-      <div style={{ marginTop: '10px', display: 'flex', justifyContent: 'center' }}>
77
-        <AuthButton name="admin.documentVerify.id.put" noRight={null}>
78
-          <Button type="primary" onClick={() => handleOk()}>通过</Button>
79
-        </AuthButton>
80
-        &nbsp;&nbsp;&nbsp;&nbsp;
81
-        <AuthButton name="admin.documentVerify.id.put" noRight={null}>
82
-          <Button onClick={() => onVerify(2)}>不通过</Button>
83
-        </AuthButton>
84
-        &nbsp;&nbsp;&nbsp;&nbsp;
85
-        <Button onClick={cancelPage}>返回</Button>
190
+      {/* <div>111</div> */}
191
+      <div>
192
+        {
193
+          // data.consultant && data.consultant.projects.map((item, _) => <span>{item}</span>)
194
+          data.map((data, inx) =>
195
+            <Card data={data}></Card>
196
+          )
197
+        }
198
+        {/* <Card data = {data.records}></Card> */}
199
+        <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
200
+          <Pagination showQuickJumper defaultCurrent={1} total={datas.total} pageSize={datas.size} onChange={changePageNum} current={datas.current} />
201
+        </div>
86 202
 
87 203
       </div>
88 204
 
89 205
 
206
+
207
+
90 208
     </>
91 209
   )
92 210
 }

+ 25
- 26
src/pages/system/document/list.jsx Прегледај датотеку

@@ -56,23 +56,14 @@ function body(props) {
56 56
   }
57 57
 
58 58
   function audit(record){
59
-    if(record.verifyStatus === 0){
59
+    
60 60
       router.push({
61 61
         pathname: '/system/document/audit',
62 62
         query: {
63
-          id: record.documentVerifyId,
63
+          id: record.personId,
64 64
         },
65 65
       })
66
-    }
67
-  else{
68
-    router.push({
69
-      pathname: '/system/document/see',
70
-      query: {
71
-        id: record.documentVerifyId,
72
-      },
73
-    })
74
-      
75
-    }
66
+   
76 67
   }
77 68
 
78 69
   const columns = [
@@ -80,38 +71,46 @@ function body(props) {
80 71
       title: '姓名',
81 72
       dataIndex: 'name',
82 73
       key: 'name',
74
+      align: 'center',
83 75
     },
84 76
     {
85 77
       title: '手机号',
86 78
       dataIndex: 'tel',
87 79
       key: 'tel',
80
+      align: 'center',
88 81
     },
89 82
     {
90 83
       title: '提交时间',
91
-      dataIndex: 'createDate',
92
-      key: 'createDate',
93
-      render: (createDate) => moment(createDate).format('YYYY-MM-DD')
84
+      dataIndex: 'summitDate',
85
+      key: 'summitDate',
86
+      align: 'center',
87
+      render: (summitDate) => moment(summitDate).format('YYYY-MM-DD HH:mm:ss')
94 88
     },
89
+
95 90
     {
96
-      title: '状态',
97
-      dataIndex: 'verifyStatus',
98
-      key: 'verifyStatus',
99
-      render: (x,row) => (
100
-        <>
101
-         
102
-            <span style={{ cursor: 'pointer' }}>{ row.verifyStatus === 0 ? '未审核' : row.verifyStatus === 1 ? '审核通过' : '审核未通过' }</span>
103
-           
104
-        </>
105
-      )
91
+      title: '已审核数',
92
+      dataIndex: 'totalSummit',
93
+      key: 'totalSummit',
94
+      align: 'center',
106 95
     },
96
+
97
+    {
98
+      title: '未审核数',
99
+      dataIndex: 'unverified',
100
+      key: 'unverified',
101
+      align: 'center',
102
+    },
103
+
104
+   
107 105
     {
108 106
       title: '操作',
109 107
       dataIndex: 'documentVerifyId',
110 108
       key: 'documentVerifyId',
109
+      align: 'center',
111 110
       render: (x,row) => (
112 111
         <>
113 112
           <AuthButton name="admin.documentVerify.id.get" noRight={null}>
114
-            <span style={{ color: '#1990FF',cursor: 'pointer' }} onClick={()=>audit(row)}>{ row.verifyStatus === 0 ? '审核' : '查看' }</span>
113
+            <span style={{ color: '#1990FF',cursor: 'pointer' }} onClick={()=>audit(row)}>{ row.unverified === 0 ? '查看' : '审核' }</span>
115 114
            </AuthButton>
116 115
         </>
117 116
       )

+ 0
- 62
src/pages/system/document/see.jsx Прегледај датотеку

@@ -1,62 +0,0 @@
1
-import React, { useState, useEffect } from 'react';
2
-import { Col, Row, Button, Modal } from 'antd'
3
-import { router } from 'umi';
4
-import ZmageImg from '../../../components/ZmageImg/ZmageImg'
5
-import request from '../../../utils/request';
6
-import apis from '../../../services/apis';
7
-
8
-
9
-function body (props) {
10
-  const documentVerifyId = props.location.query.id
11
-  const [data, setData] = useState([])
12
-
13
-  useEffect(() => {
14
-    getList()
15
-  }, [])
16
-// , documentVerifyId: documentVerifyId
17
-  function getList (_params) {
18
-    // 网路请求
19
-    console.log(props, '1111')
20
-    request({ ...apis.system.documentVerifyDetail, urlData: { id: documentVerifyId } }).then(data => {
21
-      console.log('data:', data.imgList)
22
-      setData(data.imgList)
23
-    }).catch(_err => {
24
-      // eslint-disable-next-line no-unused-expressions
25
-
26
-    })
27
-  }
28
-
29
-
30
-  const cancelPage = () => {
31
-    router.push({
32
-      pathname: '/system/document/list',
33
-    });
34
-  }
35
-
36
-
37
-  return (
38
-    <>
39
-      <div style={{ background: '#ECECEC', padding: '30px' }}>
40
-        <Row gutter={16}>
41
-          {
42
-            // data.consultant && data.consultant.projects.map((item, _) => <span>{item}</span>)
43
-            data.map(item =>
44
-              <Col span={6} key={item.documentImgId}>
45
-               <ZmageImg style={{ width: '300px', height: '400px' }} src={item.img} />
46
-              </Col>,
47
-            )
48
-          }
49
-        </Row>
50
-      </div>
51
-      <div style={{ marginTop: '10px', display: 'flex', justifyContent: 'center' }}>
52
-
53
-        <Button onClick={cancelPage}>返回</Button>
54
-
55
-      </div>
56
-
57
-
58
-    </>
59
-  )
60
-}
61
-
62
-export default body

+ 2
- 2
src/pages/system/editPolicy.jsx Прегледај датотеку

@@ -48,11 +48,11 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
48 48
         value: policyData.cityId,
49 49
       },
50 50
       {
51
-        label: '政策图',
51
+        label: '购房政策封面图',
52 52
         name: 'policyImg',
53 53
         type: FieldTypes.ImageUploader,
54 54
         value: policyData.policyImg,
55
-        help: '建议图片尺寸:660px*416px',
55
+        help: '建议图片尺寸:220*176px,比例5:4,格式:jpg,用于购房百科列表',
56 56
       },
57 57
       {
58 58
         label: '政策标题',

+ 38
- 0
src/services/apis.js Прегледај датотеку

@@ -1,4 +1,6 @@
1 1
 const prefix = '/api/admin'
2
+// 高德地图
3
+const amapPrefix = '/gaode_amap'
2 4
 
3 5
 export default {
4 6
   image: {
@@ -236,6 +238,11 @@ export default {
236 238
       url: `${prefix}/consultant`,
237 239
       action: 'admin.consultant.get',
238 240
     },
241
+    buildingConsultant: {
242
+      method: 'GET',
243
+      url: `${prefix}/building/consultant`,
244
+      action: 'admin.building.consultant.get',
245
+    },
239 246
     recommendEdit: {
240 247
       method: 'PUT',
241 248
       url: `${prefix}/customer/recommend/edit/:id`,
@@ -281,6 +288,11 @@ export default {
281 288
       url: `${prefix}/customer/recommend/export`,
282 289
       action: 'admin.customer.recommend.export.get',
283 290
     },
291
+    recommendClient: {
292
+      method: 'GET',
293
+      url: `${prefix}/customer/recommend/:id`,
294
+      action: 'admin.customer.recommend.get',
295
+    },
284 296
   },
285 297
   indexEcharts: {
286 298
     list:{
@@ -765,6 +777,16 @@ export default {
765 777
     method: 'post',
766 778
     action: 'admin.top.update.post',
767 779
   },
780
+  cancel: {
781
+    method: 'PUT',
782
+    url: `${prefix}/helpActivity/cancel/:id`,
783
+    action: 'admin.helpActivity.update.put',
784
+  },
785
+  send: {
786
+    url: `${prefix}/helpActivity/send/:id`,
787
+    method: 'PUT',
788
+    action: 'admin.helpActivity.update.put',
789
+  },
768 790
   record: {
769 791
     url: `${prefix}/helpRecord`,
770 792
     method: 'get',
@@ -827,6 +849,16 @@ export default {
827 849
     method: 'put',
828 850
     action: 'admin.taShareActivity.finish.put',
829 851
   },
852
+  send: {
853
+    url: `${prefix}/taShareActivity/send/:id`,
854
+    method: 'PUT',
855
+    action: 'admin.taShareActivity.finish.put',
856
+  },
857
+  cancel: {
858
+    method: 'PUT',
859
+    url: `${prefix}/taShareActivity/cancel/:id`,
860
+    action: 'admin.taShareActivity.finish.put',
861
+  },
830 862
   top: {
831 863
     url: `${prefix}/taShareActivity/weight`,
832 864
     method: 'put',
@@ -891,5 +923,11 @@ export default {
891 923
     method: 'GET',
892 924
     action: 'admin.posterTemplate.get',
893 925
   },
926
+ },
927
+ amap: { // 高德地图
928
+   webService: { // Web服务Api ---- 周边搜索
929
+     url: `${amapPrefix}/place/around`,
930
+     method: 'GET',
931
+   },
894 932
  }
895 933
 }

+ 8
- 4
src/utils/request.js Прегледај датотеку

@@ -65,7 +65,6 @@ request.interceptors.request.use((url, options) => {
65 65
 });
66 66
 
67 67
 request.interceptors.response.use(async (response, options) => {
68
-
69 68
   if (response && response.status) {
70 69
     if (response.status != 200) {
71 70
       const errorText = codeMessage[response.status] || response.statusText;
@@ -76,12 +75,17 @@ request.interceptors.response.use(async (response, options) => {
76 75
       });
77 76
       throw new Error(response.statusText);
78 77
     } else {
79
-      console.log('response.headers: ', response.headers)
80
-      console.log('response.headers.Content-Type: ', response.headers.get('Content-Type'))
78
+      // console.log('response.headers: ', response.headers)
79
+      // console.log('response.headers.Content-Type: ', response.headers.get('Content-Type'))
81 80
       if (response.headers.get('Content-Type') === 'application/octet-stream;charset=utf-8') {
82 81
         return await response.clone().blob();
83 82
       }
84 83
 
84
+      // 高德地图的数据,直接返回
85
+      if (response.url.indexOf('gaode_amap') !== -1) {
86
+        return await response.clone().json();
87
+      }
88
+
85 89
       const { code, data, message } = await response.clone().json();
86 90
       if (code != 1000) {
87 91
         if (code === 1001) {
@@ -92,7 +96,7 @@ request.interceptors.response.use(async (response, options) => {
92 96
           throw new Error('请登录系统');
93 97
         } else {
94 98
           notification.error({
95
-            message,
99
+            message: message || '请求错误',
96 100
             // description: message,
97 101
           });
98 102
           throw new Error(message);