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

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

张延森 пре 5 година
родитељ
комит
8c41dcfeaf
100 измењених фајлова са 5052 додато и 642 уклоњено
  1. 113
    41
      config/routes.js
  2. 2
    1
      package.json
  3. BIN
      src/assets/head1.png
  4. BIN
      src/assets/head2.png
  5. BIN
      src/assets/head3.png
  6. BIN
      src/assets/link.png
  7. 3
    2
      src/components/AuthButton/index.jsx
  8. 106
    32
      src/components/Cards/PosterCard.jsx
  9. 17
    20
      src/components/SelectButton/BuildSelect.jsx
  10. 6
    6
      src/components/SelectButton/CitySelect.jsx
  11. 63
    0
      src/components/SelectButton/CitySelect2.jsx
  12. 1
    1
      src/components/SelectButton/NewTypeSelect.jsx
  13. 1
    1
      src/components/XForm/ImageUpload.jsx
  14. 1
    1
      src/components/XForm/WrapperForm.jsx
  15. 2
    1
      src/components/XForm/WrapperItem.jsx
  16. 12
    6
      src/layouts/BasicLayout.jsx
  17. 1
    1
      src/layouts/BlankLayout.jsx
  18. 34
    0
      src/layouts/SearchList/BodyBodyPagination.jsx
  19. 17
    0
      src/layouts/SearchList/BodyHeader.jsx
  20. 28
    0
      src/layouts/SearchList/SearchBody.jsx
  21. 12
    0
      src/layouts/SearchList/SearchForm.jsx
  22. 116
    0
      src/layouts/SearchList/index.jsx
  23. 40
    0
      src/layouts/SearchList/style.less
  24. 34
    0
      src/layouts/SearchList/utils.js
  25. 2
    1
      src/models/login.js
  26. 1
    1
      src/models/user.js
  27. 75
    38
      src/pages/activity/ActivityList.jsx
  28. 427
    0
      src/pages/activity/detailActivity.jsx
  29. 1
    0
      src/pages/activity/drainage/Detail.jsx
  30. 201
    56
      src/pages/activity/drainage/DrainageList.jsx
  31. 87
    0
      src/pages/activity/drainage/detailDrainage.jsx
  32. 6
    6
      src/pages/activity/editActivity.jsx
  33. 399
    0
      src/pages/activity/groupActivity/detailActivity.jsx
  34. 5
    5
      src/pages/activity/groupActivity/editGroupActivity.jsx
  35. 3
    3
      src/pages/activity/groupActivity/helpRecord.jsx
  36. 36
    17
      src/pages/activity/groupActivity/list.jsx
  37. 397
    0
      src/pages/activity/helpActivity/detailActivity.jsx
  38. 5
    5
      src/pages/activity/helpActivity/edithelpActivity.jsx
  39. 0
    2
      src/pages/activity/helpActivity/helpRecord.jsx
  40. 38
    9
      src/pages/activity/helpActivity/list.jsx
  41. 546
    0
      src/pages/activity/helpActivity/signList.jsx
  42. 6
    2
      src/pages/building/list/add/components/base.jsx
  43. 2
    0
      src/pages/building/list/add/components/buildingImage.jsx
  44. 13
    3
      src/pages/building/list/add/components/buildingProjectType.jsx
  45. 3
    2
      src/pages/building/list/add/components/imageSet.jsx
  46. 3
    3
      src/pages/building/list/add/components/modalImage.jsx
  47. 2
    2
      src/pages/building/list/add/components/poster.jsx
  48. 1
    1
      src/pages/building/list/add/components/share.jsx
  49. 64
    63
      src/pages/building/list/index.jsx
  50. 12
    2
      src/pages/building/list/style.less
  51. 17
    13
      src/pages/building/type/index.jsx
  52. 63
    22
      src/pages/carouselFigure/SelectActivity.jsx
  53. 57
    20
      src/pages/carouselFigure/SelectGroup.jsx
  54. 111
    0
      src/pages/carouselFigure/SelectH5.1.jsx
  55. 123
    0
      src/pages/carouselFigure/SelectH5.jsx
  56. 55
    20
      src/pages/carouselFigure/SelectHelp.jsx
  57. 54
    21
      src/pages/carouselFigure/SelectNews.jsx
  58. 67
    15
      src/pages/carouselFigure/advertisingList.jsx
  59. 61
    10
      src/pages/carouselFigure/carouselFigureList.jsx
  60. 128
    0
      src/pages/carouselFigure/customImg/edit.jsx
  61. 79
    0
      src/pages/carouselFigure/customImg/list.jsx
  62. 86
    19
      src/pages/carouselFigure/editAdvertising.jsx
  63. 90
    13
      src/pages/carouselFigure/editCarousel.jsx
  64. 293
    0
      src/pages/carouselFigure/propaganda.jsx
  65. 282
    0
      src/pages/carouselFigure/propagandaList.jsx
  66. 7
    2
      src/pages/channel/channelList.jsx
  67. 15
    7
      src/pages/channel/independentList/index.jsx
  68. 0
    0
      src/pages/channel/independentList/style.css
  69. 0
    0
      src/pages/channel/independentList/style.less
  70. 0
    0
      src/pages/channel/independentList/style.wxss
  71. 7
    2
      src/pages/customer/customerlist/components/integralRecord.jsx
  72. 63
    54
      src/pages/customer/customerlist/customerDetail.jsx
  73. 39
    19
      src/pages/customer/customerlist/index.jsx
  74. 11
    4
      src/pages/customer/customerlist/publicCustomerDetail.jsx
  75. 6
    6
      src/pages/customer/customerlist/publicStyle.less
  76. 39
    14
      src/pages/customer/customerlist/style.less
  77. 6
    2
      src/pages/customer/visiting/index.jsx
  78. 3
    1
      src/pages/indexEcharts/components/IntentionalCustomers.jsx
  79. 3
    1
      src/pages/indexEcharts/components/UserBehavior.jsx
  80. 2
    1
      src/pages/indexEcharts/newUsers.jsx
  81. 4
    0
      src/pages/indexEcharts/userBehavior.jsx
  82. 2
    1
      src/pages/indexEcharts/userSource.jsx
  83. 10
    4
      src/pages/integralMall/GoodsList.jsx
  84. 10
    4
      src/pages/integralMall/exchangeRecords.jsx
  85. 2
    2
      src/pages/integralMall/verifyList.jsx
  86. 14
    7
      src/pages/news/list/NewsList.jsx
  87. 14
    7
      src/pages/news/list/editNewsList.jsx
  88. 60
    0
      src/pages/news/list/style.less
  89. 11
    5
      src/pages/news/type/NewsType.jsx
  90. 0
    0
      src/pages/recommend/recommendCustomer/audit.jsx
  91. 0
    0
      src/pages/recommend/recommendCustomer/components/attribution.jsx
  92. 17
    10
      src/pages/recommend/recommendCustomer/index.jsx
  93. 0
    0
      src/pages/recommend/recommendCustomer/style.css
  94. 0
    0
      src/pages/recommend/recommendCustomer/style.less
  95. 0
    0
      src/pages/recommend/recommendCustomer/style.wxss
  96. 187
    0
      src/pages/record/drainage/DrainageVisitRecordList.jsx
  97. 10
    2
      src/pages/record/report/index.jsx
  98. 0
    0
      src/pages/record/report/style.css
  99. 0
    0
      src/pages/record/report/style.less
  100. 0
    0
      src/pages/record/report/style.wxss

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

@@ -103,36 +103,28 @@ export default [
103 103
                 component: './customer/drift/index',
104 104
               },
105 105
               {
106
-                path: '/customer/report/list',
107
-                name: '报备客户',
108
-                component: './customer/report/index',
109
-              },
110
-              {
111
-                path: '/customer/recommendCustomer/list',
112
-                name: '推荐客户',
113
-                component: './customer/recommendCustomer/index',
114
-              },
115
-              {
116
-                path: '/customer/recommendCustomer/audit',
117
-                name: '客户审核',
106
+                path: '/customer/customerlist/publicCustomerDetail',
107
+                name: '公客详情',
118 108
                 hideInMenu: true,
119
-                component: './customer/recommendCustomer/audit',
120
-              },
121
-              {
122
-                path: '/customer/independentList',
123
-                name: '专业经纪人',
124
-                component: './customer/independentList/index',
109
+                component: './customer/customerlist/publicCustomerDetail',
125 110
               },
111
+            ],
112
+          },
113
+          {
114
+            path: '/recommend',
115
+            name: '推荐客户',
116
+            component: '../layouts/BlankLayout',
117
+            routes: [
126 118
               {
127
-                path: '/customer/visiting',
128
-                name: '到访记录',
129
-                component: './customer/visiting/index',
119
+                path: '/recommend/recommendCustomer/list',
120
+                name: '推荐记录',
121
+                component: './recommend/recommendCustomer/index',
130 122
               },
131 123
               {
132
-                path: '/customer/customerlist/publicCustomerDetail',
133
-                name: '公客详情',
124
+                path: '/recommend/recommendCustomer/audit',
125
+                name: '客户审核',
134 126
                 hideInMenu: true,
135
-                component: './customer/customerlist/publicCustomerDetail',
127
+                component: './recommend/recommendCustomer/audit',
136 128
               },
137 129
             ],
138 130
           },
@@ -221,6 +213,11 @@ export default [
221 213
                 hideInMenu: true,
222 214
                 component: './channel/InviteClients',
223 215
               },
216
+              {
217
+                path: '/channel/independentList',
218
+                name: '专业经纪人',
219
+                component: './channel/independentList/index',
220
+              },
224 221
             ],
225 222
           },
226 223
           {
@@ -259,7 +256,7 @@ export default [
259 256
             routes: [
260 257
               {
261 258
                 path: '/activity/ActivityList',
262
-                name: '活动列表',
259
+                name: '报名活动',
263 260
                 component: './activity/ActivityList',
264 261
               },
265 262
               {
@@ -269,21 +266,16 @@ export default [
269 266
                 component: './activity/editActivity',
270 267
               },
271 268
               {
272
-                path: '/activity/SignList',
273
-                name: '报名列表',
269
+                path: '/activity/detailActivity',
270
+                name: '活动详情',
274 271
                 hideInMenu: true,
275
-                component: './activity/SignList',
272
+                component: './activity/detailActivity',
276 273
               },
277 274
               {
278
-                path: '/activity/drainage/DrainageList',
279
-                name: '全网投放引流',
280
-                component: './activity/drainage/DrainageList',
281
-              },
282
-              {
283
-                path: '/activity/drainage/Detail',
284
-                name: '查看详情',
275
+                path: '/activity/SignList',
276
+                name: '报名列表',
285 277
                 hideInMenu: true,
286
-                component: './activity/drainage/Detail',
278
+                component: './activity/SignList',
287 279
               },
288 280
               {
289 281
                 path: '/activity/helpActivity/list',
@@ -302,7 +294,12 @@ export default [
302 294
                 hideInMenu: true,
303 295
                 component: './activity/helpActivity/edithelpActivity',
304 296
               },
305
-              
297
+              {
298
+                path: '/activity/helpActivity/signList',
299
+                name: '报名列表',
300
+                hideInMenu: true,
301
+                component: './activity/helpActivity/signList',
302
+              },
306 303
               {
307 304
                 path: '/activity/groupActivity/list',
308 305
                 name: '拼团活动',
@@ -320,7 +317,37 @@ export default [
320 317
                 hideInMenu: true,
321 318
                 component: './activity/groupActivity/editgroupActivity',
322 319
               },
323
-
320
+              {
321
+                path: '/activity/groupActivity/detailActivity',
322
+                name: '活动详情',
323
+                hideInMenu: true,
324
+                component: './activity/groupActivity/detailActivity',
325
+              },
326
+              {
327
+                path: '/activity/drainage/DrainageList',
328
+                name: 'H5活动',
329
+                component: './activity/drainage/DrainageList',
330
+              },
331
+              {
332
+                path: '/activity/drainage/Detail',
333
+                name: '查看详情',
334
+                hideInMenu: true,
335
+                component: './activity/drainage/Detail',
336
+              },
337
+              {
338
+                path: '/activity/drainage/DetailDrainage',
339
+                name: 'H5详情',
340
+                hideInMenu: true,
341
+                component: './activity/drainage/DetailDrainage',
342
+              },
343
+              {
344
+                path: '/activity/helpActivity/detailActivity',
345
+                name: '活动详情',
346
+                hideInMenu: true,
347
+                component: './activity/helpActivity/detailActivity',
348
+              },
349
+              
350
+              
324 351
             ],
325 352
           },
326 353
           {
@@ -357,16 +384,22 @@ export default [
357 384
                 hideInMenu: true,
358 385
                 component: './staff/list/addRole',
359 386
               },
387
+              {
388
+                path: '/staff/list/distribution',
389
+                name: '分配归属',
390
+                hideInMenu: true,
391
+                component: './staff/list/distribution',
392
+              },
360 393
             ],
361 394
           },
362 395
           {
363 396
             path: '/carouselFigure',
364
-            name: '轮播图管理',
397
+            name: '资源位管理',
365 398
             component: '../layouts/BlankLayout',
366 399
             routes: [
367 400
               {
368 401
                 path: '/carouselFigure/carouselFigureList',
369
-                name: '轮播图列表',
402
+                name: '轮播图',
370 403
                 component: './carouselFigure/carouselFigureList',
371 404
               },
372 405
               {
@@ -386,6 +419,28 @@ export default [
386 419
                 hideInMenu: true,
387 420
                 component: './carouselFigure/editAdvertising',
388 421
               },
422
+              {
423
+                path: '/carouselFigure/propagandaList',
424
+                name: '宣传位',
425
+                component: './carouselFigure/propagandaList',
426
+              },
427
+              {
428
+                path: '/carouselFigure/propaganda',
429
+                name: '宣传位编辑',
430
+                hideInMenu: true,
431
+                component: './carouselFigure/propaganda',
432
+              },
433
+              {
434
+                path: '/carouselFigure/customImg/list',
435
+                name: '其他',
436
+                component: './carouselFigure/customImg/list',
437
+              },
438
+              {
439
+                path: '/carouselFigure/customImg/edit',
440
+                name: '其他编辑',
441
+                hideInMenu: true,
442
+                component: './carouselFigure/customImg/edit',
443
+              },
389 444
             ],
390 445
           },
391 446
           {
@@ -410,7 +465,7 @@ export default [
410 465
               },
411 466
               {
412 467
                 path: '/system/housingPolicy',
413
-                name: '购房政策维护',
468
+                name: '购房政策',
414 469
                 component: './system/housingPolicy',
415 470
               },
416 471
               {
@@ -432,6 +487,23 @@ export default [
432 487
               },
433 488
             ],
434 489
           },
490
+          {
491
+            path: '/record',
492
+            name: '数据记录',
493
+            component: '../layouts/BlankLayout',
494
+            routes: [
495
+              {
496
+                path: '/record/report/list',
497
+                name: '报备记录',
498
+                component: './record/report/index',
499
+              },
500
+              {
501
+                path: '/record/drainage/DrainageVisitRecordList',
502
+                name: '分享记录',
503
+                component: './record/drainage/DrainageVisitRecordList',
504
+              },
505
+            ],
506
+          },
435 507
           {
436 508
             component: './404',
437 509
           },

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

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

BIN
src/assets/head1.png Прегледај датотеку


BIN
src/assets/head2.png Прегледај датотеку


BIN
src/assets/head3.png Прегледај датотеку


BIN
src/assets/link.png Прегледај датотеку


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

@@ -13,11 +13,12 @@ const AuthButton = ({ children, name, noRight }) => {
13 13
 
14 14
   // const hasRight = btn.roles.some(x => current.some(y => x === y))
15 15
 
16
-  if (!btn || !btn.rolesList || !btn.rolesList.length) {
16
+  if (!btn) {
17 17
     return <>{children}</>
18 18
   }
19 19
 
20
-  const hasRight = btn.rolesList.some(x => current.some(y => x.roleId === y))
20
+  const hasRight = current.filter(x => x.code === name)[0]
21
+  
21 22
   return hasRight ? <>{children}</> : <>{noRight}</>
22 23
 }
23 24
 

+ 106
- 32
src/components/Cards/PosterCard.jsx Прегледај датотеку

@@ -1,7 +1,12 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Card, Checkbox } from 'antd';
2
+import { Card, Checkbox, Button, Upload } from 'antd';
3 3
 import apis from '../../services/apis';
4 4
 import request from '../../utils/request'
5
+import { uploaderProps } from '../../utils/upload';
6
+import head1 from '../../assets/head1.png';
7
+import head2 from '../../assets/head2.png';
8
+import head3 from '../../assets/head3.png';
9
+import link from '../../assets/link.png';
5 10
 
6 11
 const { Meta } = Card;
7 12
 
@@ -12,48 +17,117 @@ const { Meta } = Card;
12 17
  * @returns
13 18
  */
14 19
 const PosterCard = (props) => {
15
-  const [ data, setData ] = useState([])
16
-//   const [ checkedData, setCheckedData ] = useState([])
20
+  const [data, setData] = useState([])
21
+  const [indexOneUrl, setIndexOneUrl] = useState('')
22
+  const [indexTwoUrl, setIndexTwoUrl] = useState('')
23
+  const [indexThreeUrl, setIndexThreeUrl] = useState('')
24
+  let resultData = []
17 25
 
18 26
   useEffect(() => {
19
-    getCardsList(props.postType);    
20
-  },[])
27
+  }, [])
21 28
 
29
+  const handleUploadIndexOneSucess = url => {
30
+    console.log(url, "第一张图上传回调");
31
+    setIndexOneUrl(url)
32
+    resultData[0] = url
33
+    resultData[1] = indexTwoUrl
34
+    resultData[2] = indexThreeUrl
35
+    props.onChange(resultData)
36
+  }
22 37
 
23
-  const getCardsList = (postType) => {
24
-    request({ ...apis.poster.posterTemplate, params: { type: postType }}).then((data) => {
25
-        setData(data)
26
-      }).catch((err) => {
27
-        message.info(err.msg || err.message)
28
-      })
38
+  const handleUploadIndexTwoSucess = url => {
39
+    console.log(url, "第二张图上传回调");
40
+    setIndexTwoUrl(url)
41
+    resultData[0] = indexOneUrl
42
+    resultData[1] = url
43
+    resultData[2] = indexThreeUrl
44
+    props.onChange(resultData)
29 45
   }
30 46
 
31
-  const onChange = (template) => (e) => {
32
-    // debugger
33
-
34
-    if (e.target.checked) {
35
-        if (props.checkedList.indexOf(template.templateId) > -1) {
36
-            props.onChange(props.checkedList)
37
-        } else {
38
-            props.onChange(props.checkedList.concat(template.templateId))
39
-        }
40
-    } else {
41
-        props.onChange(props.checkedList.filter(x => x !== template.templateId))
42
-    }
47
+  const handleUploadIndexThreeSucess = url => {
48
+    console.log(url, "第三张图上传回调");
49
+    setIndexThreeUrl(url)
50
+    resultData[0] = indexOneUrl
51
+    resultData[1] = indexTwoUrl
52
+    resultData[2] = url
53
+    props.onChange(resultData)
43 54
   }
44 55
 
45 56
   return (
46
-      data.map(template => (
47
-        <Card
48
-            hoverable
49
-            style={{ width: 240 }}
50
-            cover={<img src={template.img} />}
51
-        >
52 57
 
53
-        <Checkbox checked={props.checkedList.indexOf(template.templateId) !== -1} onChange={onChange(template)}>生成海分享给朋友</Checkbox>
58
+    <div style={{ display: 'flex' }}>
59
+
60
+      <div style={{ width: '420px', height: '940px', display: 'inline-block', marginTop: '30px' }}>
61
+        <div style={{ width: '375px', height: '780px', backgroundColor: '#CFCFCF', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
62
+          <img style={{ width: '100%', height: '100%' }} src={indexOneUrl} alt="" />
63
+          <img src={head1} style={{ width: '66px', height: '66px', position: 'absolute', left: '20px', bottom: '38px' }} alt="" />
64
+          <p style={{ margin: '0', fontSize: '18px', position: 'absolute', left: '96px', bottom: '79px', color: '#333' }}>小五子</p>
65
+          <p style={{ margin: '0', fontSize: '15px', position: 'absolute', left: '96px', bottom: '58px', color: '#333' }}>175 1256 0225</p>
66
+          <p style={{ margin: '0', fontSize: '14px', position: 'absolute', left: '96px', bottom: '39px', color: '#666' }}>邀请您参与活动</p>
67
+          <img src={link} style={{ margin: '0', width: '80px', height: '80px', backgroundColor: '#fff', padding: '4px', borderRadius: '6px', position: 'absolute', right: '30px', bottom: '45px' }} alt="" />
68
+          <p style={{ margin: '0', fontSize: '13px', position: 'absolute', right: '30px', bottom: '20px', color: '#666' }}>长按识别更多</p>
69
+
70
+        </div>
71
+        <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>生成海报分享给朋友</p>
72
+        <p style={{ textAlign: 'center' }}>
73
+          <Upload showUploadList={false}
74
+            {...uploaderProps}
75
+            onSuccess={handleUploadIndexOneSucess}>
76
+            <Button>
77
+              上传图片
78
+          </Button>
79
+          </Upload>
80
+        </p>
81
+      </div>
82
+
83
+      <div style={{ width: '420px', height: '940px', display: 'inline-block', marginTop: '30px' }}>
84
+        <div style={{ width: '375px', height: '780px', backgroundColor: '#CFCFCF', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
85
+          <img style={{ width: '100%', height: '100%' }} src={indexTwoUrl} alt="" />
86
+          <img src={head1} style={{ width: '66px', height: '66px', position: 'absolute', left: '20px', bottom: '122px' }} alt="" />
87
+          <p style={{ margin: '0', fontSize: '18px', position: 'absolute', left: '96px', bottom: '163px', color: '#333' }}>小五子</p>
88
+          <p style={{ margin: '0', fontSize: '15px', position: 'absolute', left: '96px', bottom: '142px', color: '#333' }}>175 1256 0225</p>
89
+          <p style={{ margin: '0', fontSize: '14px', position: 'absolute', left: '96px', bottom: '121px', color: '#666' }}>邀请您参与活动</p>
90
+          <div style={{ margin: '0', width: '100%', height: '112px', backgroundColor: '#fff', position: 'absolute', left: '0px', bottom: '0.5px', }}>
91
+            <p style={{ margin: '0', fontSize: '16px', position: 'absolute', left: '30px', bottom: '58px', color: '#666' }}>长按识别小程序码</p>
92
+            <p style={{ margin: '0', fontSize: '16px', position: 'absolute', left: '30px', bottom: '31px', color: '#666' }}>进入<span style={{ margin: '0 10px', fontSize: '17px', color: '#000' }}>橙蕉</span>查看详情</p>
93
+            <img src={link} style={{ margin: '0', width: '100px', height: '100px', position: 'absolute', right: '20px', bottom: '6px' }} alt="" />
94
+          </div>
95
+        </div>
96
+        <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>生成海报分享给朋友</p>
97
+        <p style={{ textAlign: 'center' }}>
98
+          <Upload showUploadList={false}
99
+            {...uploaderProps}
100
+            onSuccess={handleUploadIndexTwoSucess}>
101
+            <Button>
102
+              上传图片
103
+          </Button>
104
+          </Upload></p>
105
+      </div>
54 106
 
55
-        </Card>
56
-      ))
107
+      <div style={{ width: '420px', height: '940px', display: 'inline-block', marginTop: '30px' }}>
108
+        <div style={{ width: '375px', height: '780px', backgroundColor: '#CFCFCF', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
109
+          <img style={{ width: '100%', height: '100%' }} src={indexThreeUrl} alt="" />
110
+          <img src={head1} style={{ width: '66px', height: '66px', position: 'absolute', left: '20px', bottom: '142px' }} alt="" />
111
+          <p style={{ margin: '0', fontSize: '18px', position: 'absolute', left: '96px', bottom: '183px', color: '#333' }}>小五子</p>
112
+          <p style={{ margin: '0', fontSize: '15px', position: 'absolute', left: '96px', bottom: '162px', color: '#333' }}>175 1256 0225</p>
113
+          <p style={{ margin: '0', fontSize: '14px', position: 'absolute', left: '96px', bottom: '141px', color: '#666' }}>邀请您参与活动</p>
114
+          <div style={{ margin: '0', width: '335px', borderRadius: '6px', height: '112px', backgroundColor: '#fff', position: 'absolute', left: '20px', bottom: '20px', }}></div>
115
+          <p style={{ margin: '0', fontSize: '16px', position: 'absolute', left: '50px', bottom: '78px', color: '#666' }}>长按识别小程序码</p>
116
+          <p style={{ margin: '0', fontSize: '16px', position: 'absolute', left: '50px', bottom: '51px', color: '#666' }}>进入<span style={{ margin: '0 10px', fontSize: '17px', color: '#000' }}>橙蕉</span>查看详情</p>
117
+          <img src={link} style={{ margin: '0', width: '100px', height: '100px', position: 'absolute', right: '50px', bottom: '26px' }} alt="" />
118
+        </div>
119
+        <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>生成海报分享给朋友</p>
120
+        <p style={{ textAlign: 'center' }}>
121
+          <Upload showUploadList={false}
122
+            {...uploaderProps}
123
+            onSuccess={handleUploadIndexThreeSucess}>
124
+            <Button>
125
+              上传图片
126
+          </Button>
127
+          </Upload>
128
+        </p>
129
+      </div>
130
+    </div>
57 131
   )
58 132
 }
59 133
 export default PosterCard

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

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

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

@@ -42,12 +42,13 @@ const CitySelect = (props) => {
42 42
   }
43 43
 
44 44
   return (
45
-      <Select 
46
-      showSearch 
45
+      <Select
46
+      {...props}
47
+      showSearch
47 48
       value={props.value}
48
-      style={{ width: '180px' }}
49
-      placeholder="请选择城市" 
50
-      onChange={props.onChange} 
49
+      style={{ width: '300px' }}
50
+      placeholder="请选择城市"
51
+      onChange={props.onChange}
51 52
       filterOption={(input, option) =>
52 53
         option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
53 54
       }
@@ -59,4 +60,3 @@ const CitySelect = (props) => {
59 60
   )
60 61
 }
61 62
 export default CitySelect
62
-

+ 63
- 0
src/components/SelectButton/CitySelect2.jsx Прегледај датотеку

@@ -0,0 +1,63 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Select } from 'antd';
3
+
4
+import request from '../../utils/request'
5
+
6
+const { Option } = Select;
7
+
8
+/**
9
+ *
10
+ *
11
+ * @param {*} props
12
+ * @returns
13
+ */
14
+const CitySelect = (props) => {
15
+  const [ data, setData ] = useState([])
16
+
17
+  useEffect(() => {
18
+    getCityList();
19
+  },[props.value])
20
+
21
+  const getCityList = (e) => {
22
+    request({
23
+        url: '/api/admin/tdCityList/tdCity',
24
+        method: 'GET',
25
+        params: {leveltype: 2, pageNum: 1,pageSize: 999},
26
+        action: 'select',
27
+    }).then((data) => {
28
+        setData(data)
29
+        getValue(data);
30
+        console.log('---123---')
31
+    })
32
+  }
33
+
34
+  /**
35
+   * 因为 有个需求是,如果这个城市被删除了,那么就直接展示为空,不能展示 cityId
36
+   */
37
+  const getValue = (data) => {
38
+    console.log(props.value)
39
+    if (props.value) {
40
+      const tempData = data.filter(f => f.id == props.value)
41
+      const va = (tempData.length > 0) ? props.value : undefined
42
+      props.onChange(va)
43
+    }
44
+  }
45
+
46
+  return (
47
+      <Select
48
+      showSearch
49
+      value={props.value}
50
+      style={{ width: '180px' }}
51
+      placeholder="请选择城市"
52
+      onChange={props.onChange}
53
+      filterOption={(input, option) =>
54
+        option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
55
+      }
56
+      >
57
+          {data.map(city => (
58
+            <Option key={city.id} value={city.id}>{city.name}</Option>
59
+          ))}
60
+      </Select>
61
+  )
62
+}
63
+export default CitySelect

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

@@ -49,7 +49,7 @@ const NewsTypeSelect = (props) => {
49 49
   }
50 50
 
51 51
   return (
52
-      <Select value={'' === value ? undefined : value} style={{ width: '180px' }} placeholder="请选择资讯类型" onChange={handleChange}>
52
+      <Select value={props.value} style={{ width: '180px' }} placeholder="请选择资讯类型" onChange={handleChange}>
53 53
           {data.map(type => (
54 54
             <Option key={type.newsTypeId} value={type.newsTypeId}>{type.newsTypeName}</Option>
55 55
           ))}

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

@@ -53,7 +53,6 @@ class ImageUpload extends React.Component {
53 53
     );
54 54
 
55 55
     const value = this.props.value;
56
-
57 56
     return (
58 57
       <Upload
59 58
         listType="picture-card"
@@ -62,6 +61,7 @@ class ImageUpload extends React.Component {
62 61
         beforeUpload={this.props.beforeUpload}
63 62
         onChange={this.handleChange}
64 63
         {...uploaderProps}
64
+        disabled={this.props.disabled}
65 65
         onSuccess={this.handleUploadSucess}
66 66
       >
67 67
         {(this.state.imageUrl || value) ? (

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

@@ -61,7 +61,7 @@ class WrapperForm extends React.Component {
61 61
 
62 62
   render () {
63 63
     const {fields, form, children, submitBtn, cancelBtn, ...formProps} = this.props;
64
-
64
+    console.log('fields:', fields)
65 65
     const FeildItems = (fields || []).filter(x => x).map((props, inx) => (<WrapperItem key={inx} {...props} form={form} />))
66 66
     
67 67
     return (

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

@@ -122,7 +122,8 @@ const WrapperItem = props => {
122 122
         Field = <Select placeholder={placeholder} style={{ width: '100%' }} {...fieldProps}>{SelectOpts}</Select>
123 123
         break;
124 124
       case FieldTypes.ImageUploader:
125
-        Field = <ImageUploader {...fieldProps}/>
125
+        const beforeUpload = { beforeUpload: props.beforeUpload }
126
+        Field = <ImageUploader {...fieldProps} { ...beforeUpload}/>
126 127
         break;
127 128
       default:
128 129
         throw new Error(`暂时不支持的组件类型: ${type}`)

+ 12
- 6
src/layouts/BasicLayout.jsx Прегледај датотеку

@@ -14,7 +14,7 @@ import RightContent from '@/components/GlobalHeader/RightContent';
14 14
 import RenderAuthorize from '@/components/Authorized';
15 15
 import { isAntDesignPro } from '@/utils/utils';
16 16
 import logo from '../assets/logo.png';
17
-  
17
+
18 18
 const footerRender = () => {
19 19
   return (
20 20
     <div
@@ -24,7 +24,13 @@ const footerRender = () => {
24 24
         fontSize: '30px',
25 25
         fontFamily: 'monospace',
26 26
         fontWeight: '200',
27
+        // height:'200px',
27 28
         color: 'rgba(102, 102, 102, 1)',
29
+        // position: 'fixed',
30
+        // bottom: '0',
31
+        // right: '0',
32
+        // marginTop: '20px',
33
+        // width:'100%'
28 34
       }}
29 35
     >
30 36
       Copy Right @ 知与行
@@ -42,7 +48,7 @@ const menuHeaderRender = (logo, title) => {
42 48
 
43 49
 const BasicLayout = props => {
44 50
   const { dispatch, children, settings } = props;
45
-  
51
+
46 52
   useEffect(() => {
47 53
     if (dispatch && !props.user.currentUser.userId) {
48 54
       dispatch({
@@ -53,7 +59,7 @@ const BasicLayout = props => {
53 59
       });
54 60
     }
55 61
   }, []);
56
-  
62
+
57 63
   const Authorized = RenderAuthorize(props.user.currentUser.roles)
58 64
 
59 65
   const handleMenuCollapse = payload => {
@@ -68,7 +74,7 @@ const BasicLayout = props => {
68 74
   const findAuthority = (path) => {
69 75
     return ((props.user.menuList || []).filter(x => x.code === path)[0] || {}).roles
70 76
   }
71
-  
77
+
72 78
   /**
73 79
    * use Authorized check all menu item
74 80
    */
@@ -92,12 +98,12 @@ const BasicLayout = props => {
92 98
       menuItemRender={(menuItemProps, defaultDom) => {
93 99
         if (menuItemProps.isUrl) {
94 100
           return defaultDom;
95
-        }        
101
+        }
96 102
         return <Link to={menuItemProps.path}>{defaultDom}</Link>;
97 103
       }}
98 104
       breadcrumbRender={(routers = []) => [
99 105
         {
100
-          path: '/welcome',
106
+          path: '/',
101 107
           breadcrumbName: formatMessage({
102 108
             id: 'menu.home',
103 109
             defaultMessage: 'Home',

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

@@ -2,7 +2,7 @@ import React from 'react';
2 2
 import { PageHeaderWrapper } from '@ant-design/pro-layout';
3 3
 
4 4
 const Layout = ({ children }) => (
5
-  <PageHeaderWrapper style={{height:'49px',background:'rgba(240,240,240,1)',paddingTop:'15px'}}>
5
+  <PageHeaderWrapper style={{height:'auto',background:'rgba(240,240,240,1)',paddingTop:'15px'}}>
6 6
     <div
7 7
       style={{
8 8
         backgroundColor: '#fff',

+ 34
- 0
src/layouts/SearchList/BodyBodyPagination.jsx Прегледај датотеку

@@ -0,0 +1,34 @@
1
+import React, { PureComponent } from 'react'
2
+import PropTypes from 'prop-types'
3
+import { Pagination } from 'antd'
4
+
5
+import Style from './style.less'
6
+
7
+export default class BodyPagination extends PureComponent {
8
+  static propTypes = {
9
+    storage: PropTypes.func,
10
+    onChange: PropTypes.func,
11
+    configs: PropTypes.object,
12
+  }
13
+
14
+  // storage = this.props.storage
15
+
16
+  handleChange = (page, pageSize) => {
17
+    if (this.props.onChange) {
18
+      this.props.onChange(page, pageSize)
19
+    }
20
+  }
21
+
22
+  render() {
23
+    return (
24
+      <div className={Style['body-paged']}>
25
+        <Pagination
26
+          showSizeChanger
27
+          onChange={this.handleChange}
28
+          onShowSizeChange={this.handleChange} 
29
+          {...(this.props.configs || {})}
30
+        />
31
+      </div>
32
+    )
33
+  }
34
+}

+ 17
- 0
src/layouts/SearchList/BodyHeader.jsx Прегледај датотеку

@@ -0,0 +1,17 @@
1
+import React, { PureComponent } from 'react'
2
+import Style from './style.less';
3
+
4
+export default class BodyHeader extends PureComponent {
5
+  render() {
6
+    return (
7
+      <div className={Style['body-header']}>
8
+        <div className={Style['body-header-title']}>
9
+          {this.props.title}
10
+        </div>
11
+        <div className={Style['body-header-action']}>
12
+          {this.props.actions}
13
+        </div>
14
+      </div>
15
+    )
16
+  }
17
+}

+ 28
- 0
src/layouts/SearchList/SearchBody.jsx Прегледај датотеку

@@ -0,0 +1,28 @@
1
+import React, { PureComponent } from 'react'
2
+import PropTypes from 'prop-types'
3
+
4
+import { Table } from 'antd'
5
+import { isFunction } from './utils'
6
+
7
+export default class SearchBody extends PureComponent {
8
+  static propTypes = {
9
+    storage: PropTypes.func,
10
+    dataSource: PropTypes.array,
11
+    configs: PropTypes.object,
12
+  }
13
+
14
+  // storage = this.props.storage
15
+
16
+  render() {
17
+    const { dataSource, configs } = this.props
18
+    const { render, ...leftProps } = configs || {}
19
+
20
+    if (isFunction(render)) {
21
+      return render(dataSource)
22
+    }
23
+
24
+    return (
25
+      <Table dataSource={dataSource} {...leftProps} />
26
+    )
27
+  }
28
+}

+ 12
- 0
src/layouts/SearchList/SearchForm.jsx Прегледај датотеку

@@ -0,0 +1,12 @@
1
+import React, { PureComponent } from 'react'
2
+
3
+export default class SearchForm extends PureComponent {
4
+  render() {
5
+    return (
6
+      <div>
7
+        
8
+      </div>
9
+    )
10
+  }
11
+}
12
+

+ 116
- 0
src/layouts/SearchList/index.jsx Прегледај датотеку

@@ -0,0 +1,116 @@
1
+import React from 'react'
2
+import PropTypes from 'prop-types'
3
+import classNames from 'classnames'
4
+import { notification } from 'antd'
5
+
6
+import SearchForm from './SearchForm'
7
+import SearchBody from './SearchBody'
8
+import BodyHeader from './BodyHeader'
9
+import BodyPagination from './BodyBodyPaginationation'
10
+import { getStorageBuilder } from './utils'
11
+import Style from './style.less'
12
+
13
+class SearchList extends React.PureComponent {
14
+  static propTypes = {
15
+    title: PropTypes.element,
16
+    actions: PropTypes.element,
17
+    search: PropTypes.object,
18
+    body: PropTypes.object,
19
+    pagination: PropTypes.object,
20
+  }
21
+
22
+  storage = getStorageBuilder(window.Math.random().toString(36).substr(2))
23
+
24
+  state = {
25
+    dataSource: [],
26
+    conditions: {},
27
+    pageConfig: {
28
+      current: 1,
29
+      pageSize: 10,
30
+      total: 0,
31
+    },
32
+  }
33
+
34
+  handlePageChange = (page, pageSize) => {
35
+    this.setState(
36
+      (state) => ({
37
+        ...state,
38
+        pageConfig: {
39
+          ...pageConfig,
40
+          current: page,
41
+          pageSize,
42
+        }
43
+      }),
44
+      this.queryData,
45
+    )
46
+  }
47
+
48
+  handleSearchSubmit = (conditions) => {
49
+    this.setState(
50
+      (state) => ({
51
+        ...state,
52
+        conditions,
53
+      }),
54
+      this.queryData,
55
+    )
56
+  }
57
+
58
+  queryData = () => {
59
+    if (this.props.service) {
60
+      const pageConfigProps = this.props.pagination || {}
61
+      const keyOfPageNumber = pageConfigProps.keyOfPageNumber || 'pageNumber'
62
+      const keyOfPageSize= pageConfigProps.keyOfPageSize || 'pageSize'
63
+      const keyOfTotalSize= pageConfigProps.keyOfTotalSize || 'total'
64
+
65
+      const { conditions = {}, pageConfig } = this.state
66
+
67
+      this.props.service({
68
+        ...conditions,
69
+        ...{
70
+          [`${keyOfPageNumber}`]: pageConfig.current,
71
+          [`${keyOfPageSize}`]: pageConfig.pageSize,
72
+        },
73
+      }).then((res) => {
74
+        const [dataSource, pageParams] = res || []
75
+
76
+        this.setState((state) => ({
77
+          ...state,
78
+          dataSource,
79
+          pageConfig: {
80
+            ...pageConfig,
81
+            total: pageParams[keyOfTotalSize],
82
+          },
83
+        }))
84
+      }).catch((e) => {
85
+        console.error(e)
86
+      })
87
+    }
88
+  }
89
+
90
+  render() {    
91
+    const {
92
+      keyOfPageNumber,
93
+      keyOfPageSize,
94
+      keyOfTotalSize,
95
+      ...leftPageParams,
96
+    } = this.props.pagination || {}
97
+
98
+    const pageConfig = {
99
+      ...leftPageParams,
100
+      ...this.state.pageConfig,
101
+    }
102
+
103
+    return (
104
+      <div className={Style['search-list']}>
105
+        <div className={Style['head']}>
106
+          <SearchForm storage={storage} onSubmit={this.handleSearchSubmit} configs={this.props.search} />
107
+        </div>
108
+        <div className={Style['body']}>
109
+          <BodyHeader storage={storage} title={this.props.title} actions={this.props.actions} />
110
+          <SearchBody storage={storage} dataSource={this.state.dataSource} configs={this.props.body} />
111
+          <BodyPagination storage={storage} onChange={this.handlePageChange} configs={pageConfig} />
112
+        </div>
113
+      </div>
114
+    )
115
+  }
116
+}

+ 40
- 0
src/layouts/SearchList/style.less Прегледај датотеку

@@ -0,0 +1,40 @@
1
+
2
+.search-list {
3
+  .head {
4
+    margin-bottom: 24px;
5
+    padding: 16px;
6
+    overflow: hidden;
7
+    background: #fff;
8
+  }
9
+
10
+  .body {
11
+    .body-header {
12
+      display: flex;
13
+      align-items: center;
14
+      justify-content: space-between;
15
+      height: 64px;
16
+      padding: 0 24px;
17
+      line-height: 64px;
18
+
19
+      .body-header-title {
20
+        flex: 1 1;
21
+        color: #000;
22
+        font-size: 16px;
23
+        line-height: 24px;
24
+      }
25
+
26
+      .body-header-action {
27
+        display: flex;
28
+        align-items: center;
29
+        justify-content: flex-end;
30
+      }
31
+
32
+    }
33
+
34
+    .body-paged {
35
+      padding: 0 24px;
36
+      float: right;
37
+      margin: 16px 0;
38
+    }
39
+  }
40
+}

+ 34
- 0
src/layouts/SearchList/utils.js Прегледај датотеку

@@ -0,0 +1,34 @@
1
+
2
+export function isFunction(fn) {
3
+  return typeof fn === 'function'
4
+}
5
+
6
+export function setStorage(k, v) {
7
+  if (typeof v !== 'object') return
8
+
9
+  window.localStorage.setItem(k, window.JSON.stringify(v))
10
+}
11
+
12
+export function getStorage(k) {
13
+  const str = window.localStorage.getItem(k);
14
+  if (!str) return;
15
+
16
+  return window.JSON.parse(str);
17
+}
18
+
19
+export function getStorageBuilder(key, initData = {}) {
20
+  setStorage(key, initData)  
21
+
22
+  return {
23
+    set: (k, v) => {
24
+      const data = getStorage(key) || {}
25
+
26
+      setStorage({ ...data, [`${k}`]: v })
27
+    },
28
+
29
+    get: (k) => {
30
+      const data = getStorage(key) || {}
31
+      return data[k]
32
+    }
33
+  }
34
+}

+ 2
- 1
src/models/login.js Прегледај датотеку

@@ -40,7 +40,8 @@ const Model = {
40 40
         }
41 41
       }
42 42
 
43
-      yield put(routerRedux.replace(redirect || '/'));
43
+      // yield put(routerRedux.replace(redirect || '/'));
44
+      yield put(routerRedux.replace('/'));
44 45
     },
45 46
 
46 47
     *getCaptcha({ payload }, { call }) {

+ 1
- 1
src/models/user.js Прегледај датотеку

@@ -34,7 +34,7 @@ const UserModel = {
34 34
       const currentUser = { ...taUser, roles: (taUser.roles || []).map(x => x.roleId) }
35 35
 
36 36
       setAllBtnAuth(buttonList)
37
-      setUserBtnAuth(currentUser.roles)
37
+      setUserBtnAuth(currentUser.buttons)
38 38
 
39 39
       return { ...state, currentUser, menuList, buttonList };
40 40
     },

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

@@ -58,7 +58,23 @@ const header = props => {
58 58
     x.send();
59 59
   }
60 60
 
61
+  const getActivityDetail = (dynamicId) => () => {
62
+    router.push({
63
+      pathname: '/activity/detailActivity',
64
+      query: {
65
+        dynamicId,
66
+      },
67
+    });
68
+  }
61 69
 
70
+  const getJoinPeople = (dynamicId) => () => {
71
+    router.push({
72
+      pathname: '/activity/SignList',
73
+      query: {
74
+        dynamicId,
75
+      },
76
+    });
77
+  }
62 78
   /**
63 79
    *
64 80
    *
@@ -72,7 +88,8 @@ const header = props => {
72 88
       key: 'title',
73 89
       align: 'center',
74 90
       // width: '15%',
75
-      render:  (x, row) => <><div style={{overflow: 'hidden',textOverflow: 'ellipsis',whiteSpace: 'nowrap', width: '201px',title:'content'}}>{row.title}</div></>,
91
+      render:  (x, row) => <><div style={{overflow: 'hidden',textOverflow: 'ellipsis',whiteSpace: 'nowrap', width: '201px',title:'content'}}>
92
+                              <span style={{color: 'blue',cursor: 'pointer'}} onClick={getActivityDetail(row.dynamicId)}>{row.title}</span></div></>,
76 93
       // width: '300px',
77 94
       // ellipsis:'true'overflow: hidden; /*溢出隐藏*/
78 95
 // text-overflow: ellipsis; /*以省略号...显示*/
@@ -92,30 +109,32 @@ const header = props => {
92 109
       dataIndex: 'count',
93 110
       key: 'count',
94 111
       align: 'center',
112
+      render:  (x, row) => <><div style={{overflow: 'hidden',textOverflow: 'ellipsis',whiteSpace: 'nowrap', width: '201px',title:'content'}}>
113
+                              <span style={{color: 'blue',cursor: 'pointer'}} onClick={getJoinPeople(row.dynamicId)}>{row.count}</span></div></>,
95 114
       // width: '10%',
96 115
       // width: '6%',
97 116
     },
98
-    {
99
-      title: '阅读量',
100
-      dataIndex: 'pvNum',
101
-      key: 'pvNum',
102
-      align: 'center',
103
-      // width: '10%',
104
-    },
105
-    {
106
-      title: '转发量',
107
-      dataIndex: 'shareNum',
108
-      key: 'shareNum',
109
-      align: 'center',
110
-      // width: '10%',
111
-    },
112
-    {
113
-      title: '收藏数',
114
-      dataIndex: 'saveNum',
115
-      key: 'saveNum',
116
-      align: 'center',
117
-      // width: '10%',
118
-    },
117
+    // {
118
+    //   title: '阅读量',
119
+    //   dataIndex: 'pvNum',
120
+    //   key: 'pvNum',
121
+    //   align: 'center',
122
+    //   // width: '10%',
123
+    // },
124
+    // {
125
+    //   title: '转发量',
126
+    //   dataIndex: 'shareNum',
127
+    //   key: 'shareNum',
128
+    //   align: 'center',
129
+    //   // width: '10%',
130
+    // },
131
+    // {
132
+    //   title: '收藏数',
133
+    //   dataIndex: 'saveNum',
134
+    //   key: 'saveNum',
135
+    //   align: 'center',
136
+    //   // width: '10%',
137
+    // },
119 138
     {
120 139
       title: '报名状态',
121 140
       dataIndex: 'activityStatus',
@@ -137,20 +156,25 @@ const header = props => {
137 156
       align: 'center',
138 157
       render: (x, row) => (
139 158
         <>
140
-          <AuthButton name="admin.SignList.get" noRight={null}>
159
+          {/* <AuthButton name="admin.SignList.get" noRight={null}>
141 160
           {(row.activityStatus === 0 || row.activityStatus === 2) && <span style={{ color: '#1990FF',marginRight: '20px', cursor: 'pointer' }} onClick={getSignList.bind(this, row.dynamicId)}>报名记录{<Icon type="snippets" className={styles.shoppingCart} />}</span>}
142
-          </AuthButton>
161
+          </AuthButton> */}
143 162
           <AuthButton name="admin.buildingDynamic.send.dynamicId.put" noRight={null}>
144 163
             <span style={{ color: '#1990FF',marginRight: '20px', cursor: 'pointer' }} onClick={sendOrPublicDynamic.bind(this, row)}>{row.status === 1 ? '取消发布' : '发布'}<Icon type="close-circle" className={styles.edit} /></span>
145 164
           </AuthButton>
146 165
           <AuthButton name="admin.buildingDynamic.finish.put" noRight={null}>
147 166
             {row.activityStatus === 0 && <span style={{ color: '#1990FF',marginRight: '20px', cursor: 'pointer' }} onClick={finishDynamic.bind(this, row)}>结束活动<Icon type="poweroff" className={styles.edit} /></span>}
148 167
           </AuthButton>
149
-          <AuthButton name="admin.buildingDynamic.update.put" noRight={null}>
168
+          <AuthButton name="admin.buildingDynamic.tag" noRight={null}>
150 169
             <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row)}>{row.weight === 1 ? '取消标签' : '添加标签'}<Icon type="vertical-align-top" className={styles.edit} /></span>
170
+          </AuthButton>
171
+          <AuthButton name="admin.buildingDynamic.tag" noRight={null}>
172
+            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={homeDynamic(row)}>{row.home === 1 ? '取消推首页' : '推首页'}<Icon type="vertical-align-top" className={styles.edit} /></span>
173
+          </AuthButton>
174
+          <AuthButton name="admin.buildingDynamic.update.put" noRight={null}>
151 175
             {(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>}
152 176
           </AuthButton>
153
-      {(row.activityStatus === 0 || row.activityStatus === 2) &&<span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={newQrcode.bind(this, row)}>{'下载二维码'} {<Icon type="qrcode" className={styles.shoppingCart} />}</span>}
177
+      {/* {(row.activityStatus === 0 || row.activityStatus === 2) &&<span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={newQrcode.bind(this, row)}>{'下载二维码'} {<Icon type="qrcode" className={styles.shoppingCart} />}</span>} */}
154 178
         </>
155 179
       ),
156 180
     },
@@ -195,6 +219,19 @@ const header = props => {
195 219
     })
196 220
   }
197 221
 
222
+  //   推首页
223
+  const homeDynamic = row => () => {
224
+    const home = Math.abs(row.home - 1)
225
+    request({ ...apis.activity.home, params: { dynamicId: row.dynamicId, home } }).then(data => {
226
+      console.log(data)
227
+      message.info('操作成功!')
228
+      getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() })
229
+    }).catch(err => {
230
+      console.log(err)
231
+      message.info(err.msg || err.message)
232
+    })
233
+  }
234
+
198 235
   const sendOrPublicDynamic = row => {
199 236
     if (row.status === 1) {
200 237
       cancelDynamic(row)
@@ -305,17 +342,11 @@ const header = props => {
305 342
           )}
306 343
         </Form.Item>
307 344
         <Form.Item>
308
-          {getFieldDecorator('isEnlist')(
309
-            <Select style={{ width: '180px' }} placeholder="是否报名">
310
-              <Option value="1">已报名</Option>
311
-              <Option value="0">未报名</Option>
312
-            </Select>,
313
-          )}
314
-        </Form.Item>
315
-        <Form.Item>
316
-          <Button type="primary" htmlType="submit" className={styles.searchBtn}>
317
-            搜索
318
-          </Button>
345
+          <AuthButton name="admin.buildingDynamic.search" noRight={null}>
346
+            <Button type="primary" htmlType="submit" className={styles.searchBtn}>
347
+              搜索
348
+            </Button>
349
+          </AuthButton>
319 350
           <Button style={{ marginLeft: 8 }} onClick={handleReset}>
320 351
             重置
321 352
             </Button>
@@ -324,7 +355,13 @@ const header = props => {
324 355
       <AuthButton name="admin.buildingDynamic.add.post" noRight={null}>
325 356
         <Button type="danger" className={styles.addBtn} onClick={toEditGoods()}>新增</Button>
326 357
       </AuthButton>
327
-      <Table dataSource={data.list} columns={columns} pagination={false} rowKey="activityList" />
358
+      <Table
359
+        // onRow={record => {
360
+        //   return {
361
+        //     onClick: getActivityDetail(record.dynamicId),
362
+        //   };
363
+        // }}
364
+       dataSource={data.list} columns={columns} pagination={false} rowKey="activityList" />
328 365
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
329 366
         <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={e => changePageNum(e)} current={data.current}/>
330 367
       </div>

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

@@ -0,0 +1,427 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker, message, Upload } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import styles from '../style/GoodsList.less';
5
+import apis from '../../services/apis';
6
+import moment from 'moment';
7
+import router from 'umi/router';
8
+import BuildSelect from '../../components/SelectButton/BuildSelect'
9
+import XForm, { FieldTypes } from '../../components/XForm';
10
+import Wangedit from '../../components/Wangedit/Wangedit'
11
+import request from '../../utils/request'
12
+import yinhao from '../../assets/yinhao.png'
13
+import ImageUploader from '../../components/XForm/ImageUpload';
14
+import logo from '../../assets/logo.png';
15
+import touxiang from '../../assets/touxiang.jpg';
16
+import poster1 from '../../assets/poster1.png';
17
+import poster2 from '../../assets/poster2.png';
18
+import xiaochengxu from '../../assets/xiaochengxu.png';
19
+import AuthButton from '@/components/AuthButton';
20
+
21
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
22
+const { TextArea } = Input;
23
+
24
+const formItemLayout = {
25
+  labelCol: { span: 6 },
26
+  wrapperCol: { span: 14 },
27
+};
28
+
29
+const cancelPage = () => {
30
+  router.push({
31
+    pathname: '/activity/ActivityList',
32
+  });
33
+}
34
+
35
+const getSignList = dynamicId => {
36
+  router.push({
37
+    pathname: '/activity/SignList',
38
+    query: {
39
+      dynamicId,
40
+    },
41
+  });
42
+}
43
+
44
+const newQrcode = row => {
45
+  const x = new XMLHttpRequest();
46
+  const resourceUrl = row.qrCode
47
+  x.open('GET', resourceUrl, true);
48
+  x.responseType = 'blob';
49
+  x.onload = function (e) {
50
+    const url = window.URL.createObjectURL(x.response)
51
+    const a = document.createElement('a');
52
+    a.href = url;
53
+    a.style.display = 'none'
54
+    a.download = '活动二维码.png';
55
+    a.click();
56
+  }
57
+  x.send();
58
+}
59
+
60
+const BasicForm = props => {
61
+  const detailData = props.detailData || {}
62
+
63
+  const radioOnChange = e => {
64
+    // setIsEnlist(e.target.value)
65
+  }
66
+
67
+  const { dynamicId } = props
68
+ 
69
+  const handleSubmit = e => {
70
+    e.preventDefault();
71
+    props.form.validateFields((err, values) => {
72
+      if (!err) {
73
+        console.log('Received values of form: ', values);
74
+        const { activityTime, signupTime } = values
75
+        const [startDate, endDate] = activityTime
76
+        values.startDate = moment(startDate).format('YYYY-MM-DD HH:mm');
77
+        values.endDate = moment(endDate).format('YYYY-MM-DD HH:mm');
78
+        if (signupTime) {
79
+          const [enlistStart, enlistEnd] = signupTime
80
+          values.enlistStart = moment(enlistStart).format('YYYY-MM-DD HH:mm');
81
+          values.enlistEnd = moment(enlistEnd).format('YYYY-MM-DD HH:mm');
82
+        }
83
+        
84
+        console.log('submit data --->', values)
85
+        if (dynamicId) {
86
+          values.dynamicId = dynamicId
87
+          request({ ...apis.activity.update, data: values }).then(data => {
88
+            message.info('保存成功')
89
+            // router.go(-1)
90
+          }).catch((err) => {
91
+            message.info(err.msg || err.message)
92
+          })
93
+        } else {
94
+          request({ ...apis.activity.add, data: { ...values } }).then((data) => {
95
+            message.info('保存成功')
96
+            router.push({
97
+              pathname: '/activity/editActivity',
98
+              query: {
99
+                dynamicId: data.dynamicId,
100
+              },
101
+            });
102
+            // router.go(-1)
103
+          }).catch((err) => {
104
+            message.info(err.msg || err.message)
105
+          })
106
+        }
107
+      }
108
+    });
109
+  }
110
+
111
+  const { getFieldDecorator } = props.form;
112
+  return (
113
+    <>
114
+      <Form {...formItemLayout} onSubmit={handleSubmit}>
115
+        <Form.Item label="所属项目">
116
+        {getFieldDecorator('buildingId', {
117
+          initialValue: detailData.buildingId,
118
+          rules: [
119
+            {
120
+              required: true,
121
+              message: '请选择所属项目',
122
+            },
123
+          ],
124
+        })(<BuildSelect disabled/>)}
125
+        </Form.Item>
126
+        <Form.Item label="活动封面图1">
127
+           <img src={detailData.listImgUrl} height="210px" width="375px" />
128
+        </Form.Item>
129
+        <Form.Item label="活动封面图2">
130
+          <img src={detailData.bannerListImg} height="125px" width="375px" />
131
+        </Form.Item>
132
+        <Form.Item label="活动详情主图">
133
+          <img src={detailData.imgUrl} height="300px" width="375px" />
134
+        </Form.Item>
135
+        <Form.Item label="活动标题">
136
+          <span>{detailData.title}</span>
137
+        </Form.Item>
138
+        <Form.Item label="活动时间">
139
+          <span>{`${moment(detailData.startDate).format('YYYY-MM-DD HH:mm')} —— ${moment(detailData.endDate).format('YYYY-MM-DD HH:mm')}`}</span>
140
+        </Form.Item>
141
+        <Form.Item label="活动地点">
142
+          <span>{detailData.address}</span>
143
+        </Form.Item>
144
+        <Form.Item label="活动人数">
145
+          <span>{detailData.personNum}</span>
146
+        </Form.Item>
147
+        <Form.Item label="阅读量">
148
+          <span>{detailData.pvNum}</span>
149
+        </Form.Item>
150
+        <Form.Item label="转发量">
151
+          <span>{detailData.shareNum}</span>
152
+        </Form.Item>
153
+        <Form.Item label="收藏数">
154
+          <span>{detailData.saveNum}</span>
155
+        </Form.Item>
156
+        <Form.Item label="最大报名人数">
157
+          <span>{detailData.maxEnlistByPerson}</span>
158
+        </Form.Item>
159
+        <Form.Item label="活动详情">
160
+          <div style={{ maxHeight: '500px', overflowY: 'auto' }} dangerouslySetInnerHTML={{ __html: detailData.desc}}></div>
161
+        </Form.Item>
162
+        <Form.Item label="报名时间">
163
+          <span>{`${moment(detailData.enlistStart).format('YYYY-MM-DD HH:mm')} —— ${moment(detailData.enlistEnd).format('YYYY-MM-DD HH:mm')}`}</span>
164
+        </Form.Item>  
165
+        <Form.Item label="权重">
166
+          <span>{detailData.heavy}</span>
167
+        </Form.Item>
168
+      </Form>
169
+    </>
170
+  )
171
+}
172
+
173
+const Basic = Form.create({ name: 'BasicForm' })(BasicForm);
174
+
175
+/**
176
+ *
177
+ *
178
+ * @param {*} props
179
+ * @returns
180
+ */
181
+const Edit = props => {
182
+  const [tab, changeTab] = useState('basic')
183
+  const { dynamicId } = props.location.query
184
+  const [detailData, setDetailData] = useState(false)
185
+
186
+  const getDynamicData = dynamicId => {
187
+    request({ ...apis.activity.details, params: { dynamicId } }).then((data) => {
188
+      console.log(data)
189
+      data.activityTime = [moment(data.startDate), moment(data.endDate)]
190
+      data.signupTime = [moment(data.enlistStart), moment(data.enlistEnd)]
191
+
192
+      setDetailData(data)
193
+    })
194
+  }
195
+
196
+  
197
+    useEffect(() => {
198
+      if (dynamicId) {
199
+        getDynamicData(dynamicId);
200
+      }
201
+    }, [])
202
+
203
+
204
+  const Poster = (props) => {
205
+    const [inputValue, changeInput] = useState('')
206
+    const [textAreaValue, changeTextArea] = useState('')
207
+    const [imgValue, changeImg] = useState('')
208
+    const [posterId, setPosterId] = useState('')
209
+
210
+    if (dynamicId) {
211
+      console.log(dynamicId, 'dynamicId')
212
+      useEffect(() => {
213
+        request({ ...apis.activity.poster, params: { targetId: dynamicId, targetType: 'activity' } }).then((data) => {
214
+          console.log(data, "2222")
215
+          if (data.length > 0) {
216
+            setPosterId(data[0].posterId)
217
+            changeImg(data[0].posterImg)
218
+            changeTextArea(data[0].posterDescription)
219
+            changeInput(data[0].posterTitle)
220
+          }
221
+        }).catch((err) => {
222
+          message.info(err.msg || err.message)
223
+        })
224
+        getMiniappName()
225
+      }, [])
226
+    }else{
227
+      getMiniappName()
228
+    }
229
+    // 获取小程序名称
230
+    const [miniappName, setMiniappName] = useState('')
231
+    function getMiniappName() {
232
+      request({ ...apis.building.getMiniappName }).then(res => {
233
+        console.log(res, "0000000000000")
234
+        setMiniappName(res)
235
+      })
236
+    }
237
+
238
+    const submitPoster = () => {
239
+      if (dynamicId) {
240
+        if (posterId) {
241
+          request({ ...apis.activity.updatePoster, urlData: { id: posterId }, data: { targetId: dynamicId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
242
+            message.info("保存成功")
243
+          }).catch((err) => {
244
+            message.info(err.msg || err.message)
245
+          })
246
+        } else {
247
+          request({ ...apis.activity.addPoster, data: { targetId: dynamicId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
248
+            setPosterId(data.posterId)
249
+            message.info("保存成功")
250
+          }).catch((err) => {
251
+            message.info(err.msg || err.message)
252
+          })
253
+        }
254
+      } else {
255
+        message.warn("请先保存基本信息数据")
256
+      }
257
+    }
258
+
259
+    return <div>
260
+      <div style={{ display: 'flex' }}>
261
+        <div style={{ width: '420px', height: '900px', display: 'inline-block', marginTop: '30px' }}>
262
+          <div style={{ width: '375px', height: '700px', backgroundColor: '#fff', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
263
+            <img style={{ width: '100%', height: '300px' }} src={imgValue ? imgValue : poster1} alt="" />
264
+            <div style={{ display: 'flex', alignItems: 'center', marginTop: '-24px' }}>
265
+              <img style={{ width: '70px', height: '70px', border: '4px solid #fff', borderRadius: '35px', marginLeft: '16px' }} src={touxiang} alt="" />
266
+              <span style={{ color: '#222', fontWeight: '600', margin: '24px 10px 0 14px', fontSize: '17px' }}>喵喵</span>
267
+              <span style={{ color: '#999', marginTop: '25px', fontSize: '17px' }}>邀您参与</span>
268
+              <span style={{ color: '#999', margin: '25px 0 0 60px', fontSize: '17px' }}>2019.09.21</span>
269
+            </div>
270
+            <p style={{
271
+              margin: '10px 20px',
272
+              fontSize: '20px',
273
+              color: '#222',
274
+              fontWeight: '600',
275
+              display: '-webkit-box',
276
+              lineClamp: '3',
277
+              height: '60px',
278
+              WebkitLineClamp: '2',
279
+              WebkitBoxOrient: 'vertical',
280
+              overflow: 'hidden',
281
+              textOverflow: 'ellipsis'
282
+            }}>{inputValue ? inputValue : '海报标题'}</p>
283
+
284
+            <img src={yinhao} style={{ width: '30px', marginLeft: '20px' }} alt="" />
285
+            <p style={{
286
+              margin: '16px 20px 28px 20px',
287
+              fontSize: '17px',
288
+              color: '#999',
289
+              display: '-webkit-box',
290
+              lineClamp: '3',
291
+              height: '72px',
292
+              WebkitLineClamp: '3',
293
+              WebkitBoxOrient: 'vertical',
294
+              overflow: 'hidden',
295
+              textOverflow: 'ellipsis'
296
+            }}>{textAreaValue ? textAreaValue : '海报描述'}</p>
297
+            <div style={{ backgroundColor: '#f1f1f1', padding: '22px 30px', boxShadow: '0px 6px 12px -4px #dcdcdc', position: 'relative' }}>
298
+              <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>长按识别小程序码</p>
299
+              <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>进入<span style={{ margin: '0 5px', fontSize: '18px', color: '#333', fontWeight: '600' }}>{miniappName || '置业V顾问'}</span>报名活动</p>
300
+              <img style={{ width: '80px', position: 'absolute', right: '30px', top: '10px' }} src={xiaochengxu} alt="" />
301
+            </div>
302
+          </div>
303
+          <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
304
+        </div>
305
+
306
+        {/* <div >
307
+          <div style={{ display: 'flex', width: '100%', margin: '60px 0' }}>
308
+            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>活动海报图</p>
309
+            <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
310
+          </div>
311
+          <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:640*670px,比例64:67,格式:jpg,用于普通活动海报</p>
312
+          <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
313
+            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
314
+            <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
315
+          </div>
316
+          <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
317
+            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报描述</p>
318
+            <TextArea rows={5} value={textAreaValue} onChange={e => changeTextArea(e.target.value)} />
319
+          </div>
320
+
321
+        </div> */}
322
+      </div>
323
+      {/* <Button type="primary" onClick={submitPoster} style={{ margin: '40px 40px 40px 30vw' }}> 确定</Button>
324
+      <Button onClick={() => cancelPage()}>
325
+        取消
326
+      </Button> */}
327
+    </div>
328
+
329
+  }
330
+
331
+
332
+
333
+  const Share = (props) => {
334
+    const [inputValue, changeInput] = useState('')
335
+    const [imgValue, changeImg] = useState('')
336
+    const [shareContentId, setShareContentId] = useState('')
337
+
338
+    if (dynamicId) {
339
+      useEffect(() => {
340
+        request({ ...apis.activity.shareContent, params: { targetId: dynamicId, targetType: 'activity' }, }).then((data) => {
341
+          console.log(data, "2222")
342
+          if (data.length > 0) {
343
+            setShareContentId(data[0].shareContentId)
344
+            changeImg(data[0].shareContentImg)
345
+            changeInput(data[0].shareContentTitle)
346
+          }
347
+        }).catch((err) => {
348
+          message.info(err.msg || err.message)
349
+        })
350
+      }, [])
351
+    }
352
+
353
+    const submitShare = () => {
354
+      if (dynamicId) {
355
+        if (shareContentId) {
356
+          request({ ...apis.activity.updateShareContent, urlData: { id: shareContentId }, data: { targetId: dynamicId, shareContentType: 'activity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
357
+            message.info("保存成功")
358
+          }).catch((err) => {
359
+            message.info(err.msg || err.message)
360
+          })
361
+        } else {
362
+          request({ ...apis.activity.addShareContent, data: { targetId: dynamicId, shareContentType: 'activity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
363
+            setShareContentId(data.shareContentId)
364
+            message.info("保存成功")
365
+          }).catch(err => {
366
+            message.info(err.msg || err.message)
367
+          })
368
+        }
369
+      } else {
370
+        message.warn("请先保存基本信息数据")
371
+      }
372
+    }
373
+
374
+    return <div style={{ padding: '20px' }}>
375
+      <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
376
+        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享模板</p>
377
+        <div>
378
+          <p style={{ display: 'flex', alignItems: 'center', fontSize: '14px', color: '#999', margin: '0', lineHeight: '0' }}><img src={logo} style={{ width: '22px', marginRight: '10px' }} />知与行互动</p>
379
+          <p style={{ fontSize: '16px', color: '#222', fontWeight: '600', margin: '0' }}>{inputValue ? inputValue : '置业V客厅 精准获客平台'}</p>
380
+          <img style={{ width: '200px', height: '160px' }} src={imgValue ? imgValue : poster2} alt="" />
381
+        </div>
382
+      </div>
383
+      <div style={{ display: 'flex', alignItems: 'center', width: '100%' }}>
384
+        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享标题</p>
385
+        {inputValue === '' ? '无' : <span>{inputValue}</span>}
386
+      </div>
387
+      <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
388
+        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>活动分享图</p>
389
+        {imgValue === '' ? '无':<img src={imgValue} height="120px" height="150px" />}
390
+      </div>
391
+      {/* <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
392
+      <Button onClick={() => cancelPage()}>
393
+        取消
394
+      </Button> */}
395
+    </div>
396
+  }
397
+
398
+  return (
399
+    <div>
400
+      <div>
401
+        <Radio.Group value={tab} buttonStyle="solid" onChange={e => changeTab(e.target.value)}>
402
+          <Radio.Button value="basic">基本信息</Radio.Button>
403
+          <Radio.Button value="poster">海报图片</Radio.Button>
404
+          <Radio.Button value="share">分享设置</Radio.Button>
405
+        </Radio.Group>
406
+      </div>
407
+      <div>
408
+        {tab === 'basic' && <Basic dynamicId={dynamicId} detailData={detailData} />}
409
+        {tab === 'poster' && <Poster />}
410
+        {tab === 'share' && <Share />}
411
+      </div>
412
+      <div style={{textAlign: 'center'}}>
413
+        <AuthButton name="admin.SignList.get" noRight={null}>
414
+          {(detailData.activityStatus === 0 || detailData.activityStatus === 2) && <span style={{ color: '#1990FF',marginRight: '20px', cursor: 'pointer' }} onClick={getSignList.bind(this, detailData.dynamicId)}><Button>报名记录</Button></span>}
415
+          </AuthButton>
416
+          <AuthButton name="admin.dymic.qrcode" noRight={null}>
417
+          {(detailData.activityStatus === 0 || detailData.activityStatus === 2) &&<span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={newQrcode.bind(this, detailData)}>{<Button>下载二维码</Button>}</span>}
418
+          </AuthButton>
419
+          <Button onClick={() => cancelPage()}>
420
+            取消
421
+          </Button>
422
+      </div>
423
+    </div>
424
+  );
425
+}
426
+
427
+export default Edit

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

@@ -171,6 +171,7 @@ const header = (props) => {
171 171
           <Button style={{ marginLeft: 8 }} onClick={handleReset}>
172 172
             重置
173 173
             </Button>
174
+            <Button type="danger" onClick={() => router.go(-1)} style={{ marginBottom: '18px', marginLeft: '30px' }}>返回</Button>  
174 175
         </Form.Item>
175 176
       </Form>
176 177
       <div>

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

@@ -1,5 +1,5 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, DatePicker } from 'antd';
2
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, DatePicker, Radio } from 'antd';
3 3
 import router from 'umi/router';
4 4
 import { FormattedMessage } from 'umi-plugin-react/locale';
5 5
 import styles from '../../style/GoodsList.less';
@@ -8,6 +8,7 @@ import request from '../../../utils/request';
8 8
 import XForm, { FieldTypes } from '../../../components/XForm';
9 9
 import moment from 'moment';
10 10
 import AuthButton from '../../../components/AuthButton';
11
+import ImageUploader from '../../../components/XForm/ImageUpload';
11 12
 
12 13
 const toEditList = (row) => () => {
13 14
   router.push({
@@ -63,6 +64,54 @@ const header = (props) => {
63 64
     });
64 65
   }
65 66
 
67
+  const toDrainageDetail = (drainageId) => () => {
68
+    router.push({
69
+      pathname: '/activity/drainage/DetailDrainage',
70
+      query: {
71
+        drainageId
72
+      },
73
+    });
74
+  }
75
+
76
+  const exchangeDrainage = drainage => () => {
77
+    if(drainage.status === 1){
78
+      if(drainage.isMiniapp){
79
+        Modal.confirm({
80
+          title: '下架后当前H5活动关联的小程序端开屏图、banner图等也会自动下架。',
81
+          okText: '确认',
82
+          cancelText: '取消',
83
+          onOk () {
84
+            request({ ...apis.activity.exchangeDrainage, urlData: { id: drainage.drainageId }, data: drainage }).then((data) => {
85
+              message.info('操作成功!')
86
+              gettaDrainage({ pageNum: 1, pageSize: 10 })
87
+            }).catch((err) => {
88
+              console.log(err)
89
+              message.info(err.msg || err.message)
90
+            })
91
+          }
92
+        });
93
+      }else{
94
+        request({ ...apis.activity.exchangeDrainage, urlData: { id: drainage.drainageId }, data: drainage }).then((data) => {
95
+          message.info('H5活动已下架!')
96
+          gettaDrainage({ pageNum: 1, pageSize: 10 })
97
+        }).catch((err) => {
98
+          console.log(err)
99
+          message.info(err.msg || err.message)
100
+        })
101
+      }
102
+      
103
+    }else{
104
+      request({ ...apis.activity.exchangeDrainage, urlData: { id: drainage.drainageId }, data: drainage }).then((data) => {
105
+        message.info('H5活动已上架!')
106
+        gettaDrainage({ pageNum: 1, pageSize: 10 })
107
+      }).catch((err) => {
108
+        console.log(err)
109
+        message.info(err.msg || err.message)
110
+      })
111
+    }
112
+    
113
+  }
114
+
66 115
   const columns = [
67 116
     {
68 117
       title: 'H5项目编号',
@@ -70,6 +119,13 @@ const header = (props) => {
70 119
       key: 'drainageId',
71 120
       align: 'center',
72 121
     },
122
+    {
123
+      title: '是否投放小程序',
124
+      dataIndex: 'isMiniapp',
125
+      key: 'isMiniapp',
126
+      align: 'cenxter',
127
+      render: (isMiniapp) => <span>{ isMiniapp ? '是' : '否'  }</span>, 
128
+    },
73 129
     {
74 130
       title: 'H5项目名称',
75 131
       dataIndex: 'name',
@@ -77,23 +133,23 @@ const header = (props) => {
77 133
       align: 'center',
78 134
       render: (text, datas) => <>
79 135
 
80
-        <div style={{ color: '#66B3FF' }} onClick={() => addshowModal(datas)} >{datas.name}</div>
136
+        <div style={{ color: '#66B3FF', cursor: 'pointer' }} onClick={toDrainageDetail(datas.drainageId)}>{datas.name}</div>
81 137
 
82 138
       </>
83 139
     },
84 140
     {
85
-      title: 'appid',
86
-      dataIndex: 'appid',
87
-      key: 'appid',
141
+      title: '链接地址',
142
+      dataIndex: 'h5Address',
143
+      key: 'h5Address',
88 144
       align: 'center',
89 145
       // render: (text, datas) => <div style={ { color: '#66B3FF' } } onClick= {() => addshowModal(datas)} >{ datas.name }</div>, 
90 146
     },
91 147
     {
92
-      title: 'secret',
93
-      dataIndex: 'appSecret',
94
-      key: 'appSecret',
148
+      title: '上架状态',
149
+      dataIndex: 'status',
150
+      key: 'status',
95 151
       align: 'center',
96
-      // render: (text, datas) => <div style={ { color: '#66B3FF' } } onClick= {() => addshowModal(datas)} >{ datas.name }</div>,
152
+    render: (status) => <span>{status === 1 ? '已上架' : '已下架'}</span>,
97 153
     },
98 154
     {
99 155
       title: '新建时间',
@@ -107,7 +163,7 @@ const header = (props) => {
107 163
       ),
108 164
     },
109 165
     {
110
-      title: '截止时间',
166
+      title: '自动下架时间',
111 167
       dataIndex: 'endDate',
112 168
       key: 'endDate',
113 169
       align: 'center',
@@ -117,48 +173,53 @@ const header = (props) => {
117 173
         </>
118 174
       ),
119 175
     },
120
-    {
121
-      title: '参与数',
122
-      dataIndex: 'enlistNum',
123
-      key: 'enlistNum',
124
-      align: 'center',
125
-      // render:
126
-    },
176
+    // {
177
+    //   title: '参与数',
178
+    //   dataIndex: 'enlistNum',
179
+    //   key: 'enlistNum',
180
+    //   align: 'center',
181
+    //   // render:
182
+    // },
127 183
     {
128 184
       title: '操作',
129 185
       key: 'action',
130 186
       align: 'center',
131 187
       render: (text, datas) => (
132 188
         <>
133
-          <AuthButton name="admin.customer.recommend.edit.id.put" noRight={null}>
134
-            <span style={{ right: '20px', top: '20px', fontSize: ' 0.106rem', zIndex: 1, color: '#FF7E48', cursor: 'pointer' }} onClick={toEditList(datas)}>
135
-              查看详情
136
-            </span>
137
-          </AuthButton>
189
+        <AuthButton name="admin.taDrainage.put" noRight={null}>
190
+          <span style={{ right: '20px', bottom: ' 10px', fontSize: ' 0.106rem', color: '#FF7E48', cursor: 'pointer'}} onClick={() => addshowModal(datas)}>
191
+            编辑
192
+          </span>
193
+        </AuthButton>
138 194
           <AuthButton name="admin.taDrainage.id.delete" noRight={null}>
139 195
             <span style={{ right: '20px', bottom: ' 10px', fontSize: ' 0.106rem', color: '#FF7E48', cursor: 'pointer', marginLeft: 20 }} onClick={deleteDrainage(datas.drainageId)}>
140 196
               删除
141 197
             </span>
142 198
           </AuthButton >
199
+          <AuthButton name="admin.taDrainage.publish" noRight={null}>
200
+          <span style={{ right: '20px', bottom: ' 10px', fontSize: ' 0.106rem', color: '#FF7E48', cursor: 'pointer', marginLeft: 20 }} onClick={exchangeDrainage(datas)}>
201
+            {datas.status === 1 ? '下架' : '上架'}
202
+          </span>
203
+          </AuthButton>
204
+          <AuthButton name="admin.taDrainage.data" noRight={null}>
205
+            <span style={{ right: '20px', top: '20px', fontSize: ' 0.106rem', zIndex: 1, color: '#FF7E48', cursor: 'pointer', marginLeft: 20  }} onClick={toEditList(datas)}>
206
+              数据
207
+            </span>
208
+          </AuthButton>
143 209
         </>
144 210
       ),
145 211
     },
146 212
   ];
147 213
   const Forms = props => {
148
-
149
-    console.log(date, '---------------')
150
-    console.log(formsdate.name, '---------------')
151
-    console.log(formsdate, '22222222')
152
-
153
-
154 214
     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 })
158
-      }
159
-    }, [formsDate])
160
-
161
-
215
+    // useEffect(() => {
216
+    //   if (formsDate) {
217
+    //     props.form.setFieldsValue({ ...formsDate, endDate: formsdate.endDate ? moment(formsdate.endDate, 'YYYY-MM-DD HH:mm') : null })
218
+    //   }
219
+    // }, [formsDate])
220
+
221
+    const [hiddenStatus, setHiddenStatus] = useState(formsdate.isMiniapp)
222
+    
162 223
     const handleSubmit = e => {
163 224
       e.preventDefault();
164 225
       props.form.validateFields((err, values) => {
@@ -222,28 +283,87 @@ const header = (props) => {
222 283
       },
223 284
     };
224 285
 
286
+    const changeMiniapp = e => {
287
+      if(e.target.value == 1){
288
+        setHiddenStatus(true)
289
+      }else{
290
+        setHiddenStatus(false)
291
+      }
292
+    }
293
+
225 294
     const { getFieldDecorator } = props.form;
226 295
     {/* <XForm onSubmit={handleSubmit} onCancel={handleCancel} fields={fields} ></XForm> */ }
227 296
 
228 297
     return <Form {...formItemLayout} onSubmit={handleSubmit}>
229 298
 
230
-
299
+      <Form.Item label="是否投放小程序端" help='选择是后,该活动可投放至小程序的轮播位以及开屏广告'>
300
+        {getFieldDecorator('isMiniapp',{
301
+          initialValue : formsDate.isMiniapp ? 1 : 0,
302
+          rules: [
303
+            { required: true, message: '请选择是否投放小程序' },
304
+          ],
305
+        })(
306
+          <Radio.Group onChange={changeMiniapp}>
307
+            <Radio value={1}>是</Radio>
308
+            <Radio value={0}>否</Radio>
309
+          </Radio.Group>
310
+        )}
311
+      </Form.Item>
231 312
       <Form.Item label="H5项目名称">
232
-        {getFieldDecorator('name')(
313
+        {getFieldDecorator('name',{initialValue : formsDate.name,
314
+          rules: [
315
+            { required: true, message: '请输入H5项目名称' },
316
+          ],
317
+        })(
233 318
           <Input
234 319
             placeholder="请输入H5项目名称"
235 320
           />,
236 321
         )}
237 322
       </Form.Item>
238
-      <Form.Item label="截止时间">
239
-        {getFieldDecorator('endDate')(
323
+      <Form.Item label="下架时间">
324
+        {getFieldDecorator('endDate',{initialValue : formsdate.endDate ? moment(formsdate.endDate, 'YYYY-MM-DD HH:mm:ss') : null,
325
+          rules: [
326
+            { required: true, message: '请输入下架时间' },
327
+          ]})(
240 328
           <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
329
+          showTime={{ format: 'HH:mm:ss' }}
244 330
           />,
245 331
         )}
246 332
       </Form.Item>
333
+      {hiddenStatus && (<Form.Item label="活动链接地址">
334
+        {getFieldDecorator('h5Address',{initialValue : formsDate.h5Address,
335
+          rules: [
336
+            { required: true, message: '请输入H5活动链接地址' },
337
+          ]})(
338
+          <Input
339
+            placeholder="请输入H5活动链接地址"
340
+            disabled={formsDate.isMiniapp}
341
+          />,
342
+        )}
343
+      </Form.Item>)}
344
+      {hiddenStatus && (<Form.Item label="分享设置" help="建议图片尺寸:750*600px,比例5:4,格式:jpg">
345
+          {getFieldDecorator('shareImg',{initialValue : formsDate.shareImg,
346
+          rules: [
347
+            { required: true, message: '请选择分享图片' },
348
+          ]})(<ImageUploader />)}
349
+      </Form.Item>)}
350
+      {hiddenStatus && (<Form.Item label="活动分享语">
351
+        {getFieldDecorator('shareTitle',{initialValue : formsDate.shareTitle,
352
+          rules: [
353
+            { required: true, message: '请输入活动分享语' },
354
+          ]})(
355
+          <Input
356
+            placeholder="分享语,不超过15个字"
357
+            maxLength="15"
358
+          />,
359
+        )}
360
+      </Form.Item>)}
361
+      {hiddenStatus && (<Form.Item label="中间页飞机图" help="建议图片尺寸:750*1667px,比例9:20,格式:jpg。图片底部不要放置关键信息。">
362
+          {getFieldDecorator('middleImg',{initialValue : formsDate.middleImg,
363
+          rules: [
364
+            { required: true, message: '请选择中间页飞机图' },
365
+          ]})(<ImageUploader />)}
366
+      </Form.Item>)}
247 367
       <Form.Item {...tailFormItemLayout}>
248 368
         <AuthButton name="admin.taDrainage.id.put" noRight={null}>
249 369
           <Button type="primary" htmlType="submit" className={styles.searchBtn} onClick>
@@ -272,23 +392,13 @@ const header = (props) => {
272 392
   function addshowModal (datas) {
273 393
 
274 394
     // alert(datas.drainageId)
275
-    console.log(datas, '22222222')
276
-    setFormsDate({
277
-      drainageId: datas.drainageId,
278
-      name: datas.name,
279
-      endDate: datas.endDate,
280
-    })
281
-    console.log(formsdate, '22222222')
395
+    setFormsDate(datas)
282 396
     setDate({
283 397
       visible: true,
284 398
       title: "修改H5项目"
285 399
     });
286
-
287
-
288
-    console.log('form :', props.form)
289
-
290
-
291 400
   };
401
+
292 402
   function showModal () {
293 403
     setFormsDate({
294 404
       drainageId: '',
@@ -301,7 +411,11 @@ const header = (props) => {
301 411
     });
302 412
   };
303 413
   const changePageNum = pageNumber => {
304
-    gettaDrainage({ pageNum: pageNumber, pageSize: 10 })
414
+    props.form.validateFields((err, values) => {
415
+      if (!err) {
416
+        gettaDrainage({ pageNum: pageNumber, pageSize: 10, ...values })
417
+      }
418
+    });
305 419
   }
306 420
 
307 421
   function handleOk () {
@@ -336,6 +450,12 @@ const header = (props) => {
336 450
     });
337 451
   }
338 452
 
453
+  //打开新页面
454
+  const openIndexImg = () => {
455
+    const newWin=window.open('about:blank');
456
+    newWin.location.href="https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1575977446224-1.png"
457
+  }
458
+  
339 459
   const { getFieldDecorator } = props.form;
340 460
   const { visible, confirmLoading, ModalText, title } = date;
341 461
   return (
@@ -360,10 +480,28 @@ const header = (props) => {
360 480
               />,
361 481
             )}
362 482
           </Form.Item>
483
+          <Form.Item>
484
+          {getFieldDecorator('isMiniapp')(
485
+            <Select style={{ width: '180px' }} placeholder="是否投放小程序">
486
+              <Option value="1">是</Option>
487
+              <Option value="0">否</Option>
488
+            </Select>,
489
+          )}
490
+        </Form.Item>
491
+        <Form.Item>
492
+          {getFieldDecorator('status')(
493
+            <Select style={{ width: '180px' }} placeholder="上架状态">
494
+              <Option value="1">已上架</Option>
495
+              <Option value="0">已下架</Option>
496
+            </Select>,
497
+          )}
498
+        </Form.Item>
363 499
           <Form.Item >
500
+          <AuthButton name="admin.taDrainage.search" noRight={null}>
364 501
             <Button type="primary" htmlType="submit" className={styles.searchBtn} onClick>
365 502
               搜索
366 503
           </Button>
504
+          </AuthButton>
367 505
             <Button style={{ marginLeft: 8 }} onClick={handleReset}>
368 506
               重置
369 507
             </Button>
@@ -372,6 +510,7 @@ const header = (props) => {
372 510
         <AuthButton name="admin.taDrainage.add.post" noRight={null}>
373 511
           <Button type="danger" className={styles.addBtn} onClick={showModal}>新增</Button>
374 512
         </AuthButton>
513
+          <span style={{ color: '#66B3FF', cursor: 'pointer', margin: '20px',display:'inline-block' }} onClick={openIndexImg}>优质案例</span>
375 514
         <Modal
376 515
           title={title}
377 516
 
@@ -383,7 +522,13 @@ const header = (props) => {
383 522
         >
384 523
           <Formss formsDate={formsdate} />
385 524
         </Modal>
386
-        <Table columns={columns} dataSource={datas.records} pagination={false} rowKey="drainageList" />
525
+        <Table 
526
+        // onRow={record => {
527
+        //   return {
528
+        //     onClick: toDrainageDetail(record.drainageId),
529
+        //   };
530
+        // }}
531
+        columns={columns} dataSource={datas.records} pagination={false} rowKey="drainageList" />
387 532
         <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
388 533
           <Pagination showQuickJumper defaultCurrent={1} total={datas.total} onChange={(e) => changePageNum(e)} current={datas.current} />
389 534
         </div>

+ 87
- 0
src/pages/activity/drainage/detailDrainage.jsx Прегледај датотеку

@@ -0,0 +1,87 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker, message, Upload } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import apis from '../../../services/apis';
5
+import moment from 'moment';
6
+import router from 'umi/router';
7
+import request from '../../../utils/request'
8
+import AuthButton from '@/components/AuthButton';
9
+
10
+const cancelPage = () => {
11
+  router.go(-1)
12
+}
13
+
14
+const BasicForm = props => {
15
+  const { drainageId } = props.location.query
16
+  const [data, setData] = useState({})
17
+
18
+  useEffect(() => {
19
+    request({...apis.activity.detailDrainage,urlData: { id: drainageId }}).then((data) => {
20
+      setData(data);
21
+    })
22
+  }, [])
23
+
24
+  const Basic = Form.create({ name: 'BasicForm' })(BasicForm);
25
+  const formItemLayout = {
26
+    labelCol: {
27
+      xs: { span: 24 },
28
+      sm: { span: 8 },
29
+    },
30
+    wrapperCol: {
31
+      xs: { span: 24 },
32
+      sm: { span: 16 },
33
+    },
34
+  };
35
+  return (
36
+    <>
37
+      <Form  {...formItemLayout}>
38
+        <Form.Item label="H5活动编号:">
39
+          <span>{data.drainageId}</span>
40
+        </Form.Item>
41
+        <Form.Item label="是否投放小程序:">
42
+        <span>{data.isMiniapp ? "是" : "否"}</span>
43
+        </Form.Item>
44
+        <Form.Item label="H5活动名称:">
45
+        <span>{data.name}</span>
46
+        </Form.Item>
47
+        {data.isMiniapp && <Form.Item label="链接地址:">
48
+        <span>{data.h5Address}</span>
49
+        </Form.Item>}
50
+        <Form.Item label="上架状态:">
51
+        <span>{data.status === 1 ? "已上架" : "未上架"}</span>
52
+        </Form.Item>
53
+        <Form.Item label="新建时间:">
54
+        <span>{moment(data.createDate).format('YYYY-MM-DD HH:mm:ss')}</span>
55
+        </Form.Item>
56
+        <Form.Item label="自动下架时间:">
57
+        <span>{moment(data.endDate).format('YYYY-MM-DD HH:mm:ss')}</span>
58
+        </Form.Item>
59
+        <Form.Item label="appid:">
60
+        <span>{data.appid}</span>
61
+        </Form.Item>
62
+        <Form.Item label="secret:">
63
+        <span>{data.appSecret}</span>
64
+        </Form.Item>
65
+        <Form.Item label="参与人数:">
66
+        <span>{data.enlistNum}</span>
67
+        </Form.Item>
68
+        {data.isMiniapp && <Form.Item label="分享语:">
69
+        <span>{data.shareTitle}</span>
70
+        </Form.Item>}
71
+        {data.isMiniapp && <Form.Item label="分享图:">
72
+        <img src={data.shareImg} width="75px" height="60px" />
73
+        </Form.Item>}
74
+        {data.isMiniapp && <Form.Item label="中间页飞机图:">
75
+        <img src={data.middleImg} width="75px" height="166.7px" />
76
+        </Form.Item>}
77
+        <Form.Item wrapperCol={{ span: 12, offset: 8 }}>
78
+          <Button onClick={() => cancelPage()}>
79
+            取消
80
+          </Button>
81
+        </Form.Item>
82
+      </Form>
83
+    </>
84
+  );
85
+}
86
+
87
+export default BasicForm

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

@@ -120,7 +120,7 @@ const BasicForm = props => {
120 120
           ],
121 121
         })(<BuildSelect disabled={disable}/>)}
122 122
         </Form.Item>
123
-        <Form.Item label="活动封面图1" help="建议图片尺寸:750px*420px,比例16:9,格式:jpg,用于活动列表">
123
+        <Form.Item label="活动封面图1" help="建议图片尺寸:750px*420px,比例16:9,格式:jpg,用于:首页推荐/活动列表">
124 124
           {getFieldDecorator('listImgUrl', {
125 125
           rules: [
126 126
             {
@@ -130,7 +130,7 @@ const BasicForm = props => {
130 130
           ],
131 131
         })(<ImageUploader />)}
132 132
         </Form.Item>
133
-        <Form.Item label="活动封面图2" help="建议图片尺寸:750*250,比例3:1,格式:jpg,用于:项目详情活动轮播">
133
+        <Form.Item label="活动封面图2" help="建议图片尺寸:750*250,比例3:1,格式:jpg,用于:项目详情">
134 134
           {getFieldDecorator('bannerListImg', {
135 135
           rules: [
136 136
             {
@@ -140,7 +140,7 @@ const BasicForm = props => {
140 140
           ],
141 141
         })(<ImageUploader />)}
142 142
         </Form.Item>
143
-        <Form.Item label="活动详情主图" help="建议图片尺寸:750*600px,比例5:4,格式:jpg,用于普通活动详情">
143
+        <Form.Item label="活动详情主图" help="建议图片尺寸:750*600px,比例5:4,格式:jpg,用于普通活动详情">
144 144
           {getFieldDecorator('imgUrl', {
145 145
           rules: [
146 146
             {
@@ -198,7 +198,7 @@ const BasicForm = props => {
198 198
               message: '请输入最大报名人数',
199 199
             },
200 200
           ],
201
-        })(<Input type="number" disabled={activityStatus===0 ? true : false}/>)}
201
+        })(<Input type="number" min={1} disabled={activityStatus===0 ? true : false}/>)}
202 202
         </Form.Item>
203 203
         <Form.Item label="活动详情">
204 204
         {getFieldDecorator('desc')(<Wangedit />)}
@@ -364,7 +364,7 @@ const Edit = props => {
364 364
           </div>
365 365
           <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
366 366
             <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报描述</p>
367
-            <TextArea rows={5} value={textAreaValue} onChange={e => changeTextArea(e.target.value)} />
367
+            <TextArea rows={5} maxLength={1024} value={textAreaValue} onChange={e => changeTextArea(e.target.value)} />
368 368
           </div>
369 369
 
370 370
         </div>
@@ -426,7 +426,7 @@ const Edit = props => {
426 426
         <div>
427 427
           <p style={{ display: 'flex', alignItems: 'center', fontSize: '14px', color: '#999', margin: '0', lineHeight: '0' }}><img src={logo} style={{ width: '22px', marginRight: '10px' }} />知与行互动</p>
428 428
           <p style={{ fontSize: '16px', color: '#222', fontWeight: '600', margin: '0' }}>{inputValue ? inputValue : '置业V客厅 精准获客平台'}</p>
429
-          <img style={{ width: '200px', height: '140px' }} src={imgValue ? imgValue : poster2} alt="" />
429
+          <img style={{ width: '200px', height: '160px' }} src={imgValue ? imgValue : poster2} alt="" />
430 430
         </div>
431 431
       </div>
432 432
       <div style={{ display: 'flex', alignItems: 'center', width: '100%' }}>

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

@@ -0,0 +1,399 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker, message, Upload } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import styles from '../../style/GoodsList.less';
5
+import apis from '../../../services/apis';
6
+import moment from 'moment';
7
+import router from 'umi/router';
8
+import BuildSelect from '../../../components/SelectButton/BuildSelect'
9
+import XForm, { FieldTypes } from '../../../components/XForm';
10
+import Wangedit from '../../../components/Wangedit/Wangedit'
11
+import request from '../../../utils/request'
12
+import yinhao from '../../../assets/yinhao.png'
13
+import ImageUploader from '../../../components/XForm/ImageUpload';
14
+import logo from '../../../assets/logo.png';
15
+import touxiang from '../../../assets/touxiang.jpg';
16
+import poster1 from '../../../assets/poster1.png';
17
+import poster2 from '../../../assets/poster2.png';
18
+import xiaochengxu from '../../../assets/xiaochengxu.png';
19
+import AuthButton from '@/components/AuthButton';
20
+
21
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
22
+const { TextArea } = Input;
23
+
24
+const formItemLayout = {
25
+  labelCol: { span: 6 },
26
+  wrapperCol: { span: 14 },
27
+};
28
+
29
+const cancelPage = () => {
30
+  router.push({
31
+    pathname: '/activity/groupActivity/list',
32
+  });
33
+}
34
+
35
+const getSignList = groupActivityId => {
36
+    router.push({
37
+        pathname: '/activity/groupActivity/helpRecord',
38
+        query: {
39
+            groupActivityId,
40
+        },
41
+      });
42
+}
43
+
44
+const BasicForm = props => {
45
+  // const [activityStatus, setActivityStatus] = useState(1)
46
+  // const [disable, setDisable] = useState(false)
47
+  // const [detailData, setDetailData] = useState(false)
48
+
49
+  const { groupActivityId } = props
50
+
51
+  const detailData = props.detailData || {}
52
+ 
53
+  const handleSubmit = e => {
54
+    e.preventDefault();
55
+    props.form.validateFields((err, values) => {
56
+      if (!err) {
57
+        console.log('Received values of form: ', values);
58
+        const { activityTime, signupTime } = values
59
+        const [startDate, endDate] = activityTime
60
+        values.startDate = moment(startDate).format('YYYY-MM-DD HH:mm');
61
+        values.endDate = moment(endDate).format('YYYY-MM-DD HH:mm');
62
+        if (signupTime) {
63
+          const [enlistStart, enlistEnd] = signupTime
64
+          values.enlistStart = moment(enlistStart).format('YYYY-MM-DD HH:mm');
65
+          values.enlistEnd = moment(enlistEnd).format('YYYY-MM-DD HH:mm');
66
+        }
67
+        
68
+        console.log('submit data --->', values)
69
+        if (groupActivityId) {
70
+          values.groupActivityId = groupActivityId
71
+          request({ ...apis.groupActivity.update, data: values }).then(data => {
72
+            message.info('保存成功')
73
+            // router.go(-1)
74
+          }).catch((err) => {
75
+            message.info(err.msg || err.message)
76
+          })
77
+        } else {
78
+          request({ ...apis.groupActivity.add, data: { ...values } }).then((data) => {
79
+            message.info('保存成功')
80
+            router.push({
81
+              pathname: '/activity/groupActivity/edithelpActivity',
82
+              query: {
83
+                groupActivityId: data.groupActivityId,
84
+              },
85
+            });
86
+            // router.go(-1)
87
+          }).catch((err) => {
88
+            message.info(err.msg || err.message)
89
+          })
90
+        }
91
+      }
92
+    });
93
+  }
94
+
95
+  const { getFieldDecorator } = props.form;
96
+  return (
97
+    <>
98
+      <Form {...formItemLayout} onSubmit={handleSubmit}>
99
+        <Form.Item label="所属项目">
100
+        {getFieldDecorator('buildingId', {
101
+          initialValue: detailData.buildingId,
102
+          rules: [
103
+            {
104
+              required: true,
105
+              message: '请选择所属项目',
106
+            },
107
+          ],
108
+        })(<BuildSelect disabled/>)}
109
+        </Form.Item>
110
+        <Form.Item label="活动标题">
111
+          <span>{detailData.activityName}</span>
112
+        </Form.Item>
113
+        <Form.Item label="拼团详情主图">
114
+          <img src={detailData.mainImg} height="300px" width="375px" />
115
+        </Form.Item>
116
+        <Form.Item label="拼团封面图1">
117
+           <img src={detailData.listImg} height="210px" width="375px" />
118
+        </Form.Item>
119
+        <Form.Item label="拼团封面图2">
120
+          <img src={detailData.bannerListImg} height="125px" width="375px" />
121
+        </Form.Item>
122
+        <Form.Item label="活动时间">
123
+          <span>{`${moment(detailData.startDate).format('YYYY-MM-DD HH:mm:ss')} —— ${moment(detailData.endDate).format('YYYY-MM-DD HH:mm:ss')}`}</span>
124
+        </Form.Item>
125
+        <Form.Item label="成团人数">
126
+            <span>{detailData.groupBuyPeople}</span>
127
+        </Form.Item>
128
+        <Form.Item label="所需积分">
129
+            <span>{detailData.integral}</span>
130
+        </Form.Item>
131
+        <Form.Item label="活动说明">
132
+          <img src={detailData.descImg} height="300px" width="375px" />
133
+        </Form.Item>
134
+        <Form.Item label="权重">
135
+          <span>{detailData.heavy}</span>
136
+        </Form.Item>
137
+      </Form>
138
+    </>
139
+  )
140
+}
141
+
142
+const Basic = Form.create({ name: 'BasicForm' })(BasicForm);
143
+
144
+/**
145
+ *
146
+ *
147
+ * @param {*} props
148
+ * @returns
149
+ */
150
+const Edit = props => {
151
+  const [tab, changeTab] = useState('basic')
152
+  const { groupActivityId } = props.location.query
153
+  const [detailData, setDetailData] = useState(false)
154
+
155
+  useEffect(() => {
156
+    if (groupActivityId) {
157
+      getDynamicData(groupActivityId);
158
+    }
159
+  }, [])
160
+
161
+  // 查询详情
162
+  const getDynamicData = (groupActivityId) => {
163
+    request({ ...apis.groupActivity.details, urlData: {id: groupActivityId } }).then((data) => {
164
+      console.log(data)
165
+      data.activityTime = [moment(data.startTime), moment(data.endTime)]
166
+
167
+      // setActivityStatus(data.activityStatus)
168
+      // setDisable(data.activityStatus === 0 ? true : false)
169
+      // props.form.setFieldsValue(data)
170
+      setDetailData(data)
171
+    })
172
+  }
173
+
174
+  const Poster = (props) => {
175
+    const [inputValue, changeInput] = useState('')
176
+    const [textAreaValue, changeTextArea] = useState('')
177
+    const [imgValue, changeImg] = useState('')
178
+    const [posterId, setPosterId] = useState('')
179
+
180
+    if (groupActivityId) {
181
+      console.log(groupActivityId, 'groupActivityId')
182
+      useEffect(() => {
183
+        request({ ...apis.activity.poster, params: { targetId: groupActivityId, targetType: 'groupActivity' } }).then((data) => {
184
+          if (data.length > 0) {
185
+            setPosterId(data[0].posterId)
186
+            changeImg(data[0].posterImg)
187
+            changeTextArea(data[0].posterDescription)
188
+            changeInput(data[0].posterTitle)
189
+          }
190
+        }).catch((err) => {
191
+          message.info(err.msg || err.message)
192
+        })
193
+        getMiniappName()
194
+      }, [])
195
+    }else{
196
+      getMiniappName()
197
+    }
198
+    // 获取小程序名称
199
+    const [miniappName, setMiniappName] = useState('')
200
+    function getMiniappName() {
201
+      request({ ...apis.building.getMiniappName }).then(res => {
202
+        console.log(res, "0000000000000")
203
+        setMiniappName(res)
204
+      })
205
+    }
206
+
207
+    const submitPoster = () => {
208
+      if (helpActivityId) {
209
+        if (posterId) {
210
+          request({ ...apis.activity.updatePoster, urlData: { id: posterId }, data: { targetId: groupActivityId, targetType: 'groupActivity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
211
+            message.info("保存成功")
212
+          }).catch((err) => {
213
+            message.info(err.msg || err.message)
214
+          })
215
+        } else {
216
+          request({ ...apis.activity.addPoster, data: { targetId: groupActivityId, targetType: 'groupActivity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
217
+            setPosterId(data.posterId)
218
+            message.info("保存成功")
219
+          }).catch((err) => {
220
+            message.info(err.msg || err.message)
221
+          })
222
+        }
223
+      } else {
224
+        message.warn("请先保存基本信息数据")
225
+      }
226
+    }
227
+
228
+    return <div>
229
+      <div style={{ display: 'flex' }}>
230
+        <div style={{ width: '420px', height: '900px', display: 'inline-block', marginTop: '30px' }}>
231
+          <div style={{ width: '375px', height: '700px', backgroundColor: '#fff', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
232
+            <img style={{ width: '100%', height: '300px' }} src={imgValue ? imgValue : poster1} alt="" />
233
+            <div style={{ display: 'flex', alignItems: 'center', marginTop: '-24px' }}>
234
+              <img style={{ width: '70px', height: '70px', border: '4px solid #fff', borderRadius: '35px', marginLeft: '16px' }} src={touxiang} alt="" />
235
+              <span style={{ color: '#222', fontWeight: '600', margin: '24px 10px 0 14px', fontSize: '17px' }}>喵喵</span>
236
+              <span style={{ color: '#999', marginTop: '25px', fontSize: '17px' }}>邀您参与</span>
237
+              <span style={{ color: '#999', margin: '25px 0 0 60px', fontSize: '17px' }}>2019.09.21</span>
238
+            </div>
239
+            <p style={{
240
+              margin: '10px 20px',
241
+              fontSize: '20px',
242
+              color: '#222',
243
+              fontWeight: '600',
244
+              display: '-webkit-box',
245
+              lineClamp: '3',
246
+              height: '60px',
247
+              WebkitLineClamp: '2',
248
+              WebkitBoxOrient: 'vertical',
249
+              overflow: 'hidden',
250
+              textOverflow: 'ellipsis'
251
+            }}>{inputValue ? inputValue : '海报标题'}</p>
252
+
253
+            <img src={yinhao} style={{ width: '30px', marginLeft: '20px' }} alt="" />
254
+            <p style={{
255
+              margin: '16px 20px 28px 20px',
256
+              fontSize: '17px',
257
+              color: '#999',
258
+              display: '-webkit-box',
259
+              lineClamp: '3',
260
+              height: '72px',
261
+              WebkitLineClamp: '3',
262
+              WebkitBoxOrient: 'vertical',
263
+              overflow: 'hidden',
264
+              textOverflow: 'ellipsis'
265
+            }}>{textAreaValue ? textAreaValue : '海报描述'}</p>
266
+            <div style={{ backgroundColor: '#f1f1f1', padding: '22px 30px', boxShadow: '0px 6px 12px -4px #dcdcdc', position: 'relative' }}>
267
+              <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>长按识别小程序码</p>
268
+              <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>进入<span style={{ margin: '0 5px', fontSize: '18px', color: '#333', fontWeight: '600' }}>{miniappName || '置业V顾问'}</span>报名活动</p>
269
+              <img style={{ width: '80px', position: 'absolute', right: '30px', top: '10px' }} src={xiaochengxu} alt="" />
270
+            </div>
271
+          </div>
272
+          <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
273
+        </div>
274
+
275
+        {/* <div >
276
+          <div style={{ display: 'flex', width: '100%', margin: '60px 0' }}>
277
+            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>活动海报图</p>
278
+            <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
279
+          </div>
280
+          <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:640*670px,比例64:67,格式:jpg,用于普通活动海报</p>
281
+          <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
282
+            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
283
+            <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
284
+          </div>
285
+          <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
286
+            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报描述</p>
287
+            <TextArea rows={5} value={textAreaValue} onChange={e => changeTextArea(e.target.value)} />
288
+          </div>
289
+
290
+        </div> */}
291
+      </div>
292
+      {/* <Button type="primary" onClick={submitPoster} style={{ margin: '40px 40px 40px 30vw' }}> 确定</Button>
293
+      <Button onClick={() => cancelPage()}>
294
+        取消
295
+      </Button> */}
296
+    </div>
297
+
298
+  }
299
+
300
+
301
+
302
+  const Share = (props) => {
303
+    const [inputValue, changeInput] = useState('')
304
+    const [imgValue, changeImg] = useState('')
305
+    const [shareContentId, setShareContentId] = useState('')
306
+
307
+    if (groupActivityId) {
308
+      useEffect(() => {
309
+        request({ ...apis.activity.shareContent, params: { targetId: groupActivityId, targetType: 'groupActivity' }, }).then((data) => {
310
+          if (data.length > 0) {
311
+            setShareContentId(data[0].shareContentId)
312
+            changeImg(data[0].shareContentImg)
313
+            changeInput(data[0].shareContentTitle)
314
+          }
315
+        }).catch((err) => {
316
+          message.info(err.msg || err.message)
317
+        })
318
+      }, [])
319
+    }
320
+
321
+    const submitShare = () => {
322
+      if (groupActivityId) {
323
+        if (shareContentId) {
324
+          request({ ...apis.activity.updateShareContent, urlData: { id: shareContentId }, data: { targetId: groupActivityId, shareContentType: 'groupActivity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
325
+            message.info("保存成功")
326
+          }).catch((err) => {
327
+            message.info(err.msg || err.message)
328
+          })
329
+        } else {
330
+          request({ ...apis.activity.addShareContent, data: { targetId: groupActivityId, shareContentType: 'groupActivity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
331
+            setShareContentId(data.shareContentId)
332
+            message.info("保存成功")
333
+          }).catch(err => {
334
+            message.info(err.msg || err.message)
335
+          })
336
+        }
337
+      } else {
338
+        message.warn("请先保存基本信息数据")
339
+      }
340
+    }
341
+
342
+    return <div style={{ padding: '20px' }}>
343
+      <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
344
+        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享模板</p>
345
+        <div>
346
+          <p style={{ display: 'flex', alignItems: 'center', fontSize: '14px', color: '#999', margin: '0', lineHeight: '0' }}><img src={logo} style={{ width: '22px', marginRight: '10px' }} />知与行互动</p>
347
+          <p style={{ fontSize: '16px', color: '#222', fontWeight: '600', margin: '0' }}>{inputValue ? inputValue : '置业V客厅 精准获客平台'}</p>
348
+          <img style={{ width: '200px', height: '160px' }} src={imgValue ? imgValue : poster2} alt="" />
349
+        </div>
350
+      </div>
351
+      <div style={{ display: 'flex', alignItems: 'center', width: '100%' }}>
352
+        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享标题</p>
353
+        {inputValue === '' ? '无' : <span>{inputValue}</span>}
354
+      </div>
355
+      <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
356
+        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>活动分享图</p>
357
+        {imgValue === '' ? '无':<img src={imgValue} height="120px" height="150px" />}
358
+      </div>
359
+      {/* <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
360
+      <Button onClick={() => cancelPage()}>
361
+        取消
362
+      </Button> */}
363
+    </div>
364
+  }
365
+
366
+  return (
367
+    <div>
368
+      <div>
369
+        <Radio.Group value={tab} buttonStyle="solid" onChange={e => changeTab(e.target.value)}>
370
+          <Radio.Button value="basic">基本信息</Radio.Button>
371
+          <Radio.Button value="poster">海报图片</Radio.Button>
372
+          <Radio.Button value="share">分享设置</Radio.Button>
373
+        </Radio.Group>
374
+      </div>
375
+      <div>
376
+        {tab === 'basic' && <Basic groupActivityId={groupActivityId} detailData={detailData}/>}
377
+        {tab === 'poster' && <Poster />}
378
+        {tab === 'share' && <Share />}
379
+      </div>
380
+      <div style={{textAlign: 'center'}}>
381
+        <AuthButton name="admin.share.record" noRight={null}>
382
+          {(detailData.activityStatus === 0 || detailData.activityStatus === 2) && 
383
+            <span 
384
+              style={{ color: '#1990FF',marginRight: '20px', cursor: 'pointer' }} 
385
+              onClick={getSignList.bind(this, detailData.groupActivityId)}>
386
+              <Button>拼团记录</Button>
387
+            </span>}
388
+          </AuthButton>
389
+          <Button onClick={() => cancelPage()}>
390
+            取消
391
+          </Button>
392
+      </div>
393
+
394
+    </div>
395
+    
396
+  );
397
+}
398
+
399
+export default Edit

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

@@ -95,7 +95,7 @@ const Edit = props => {
95 95
         rules: [
96 96
           { required: true, message: '请输入拼团详情主图' },
97 97
         ],
98
-        help: '建议图片尺寸:750*600px,比例5:4,格式:jpg,用于拼团活动详情',
98
+        help: '建议图片尺寸:750*600px,比例5:4,格式:jpg,用于拼团活动详情',
99 99
       },
100 100
       {
101 101
         label: '拼团封面图1',
@@ -105,7 +105,7 @@ const Edit = props => {
105 105
         rules: [
106 106
           { required: true, message: '请输入拼团封面图1' },
107 107
         ],
108
-        help: '建议图片尺寸:750*420px,比例16:9,格式:jpg,用于活动列表',
108
+        help: '建议图片尺寸:750*420px,比例16:9,格式:jpg,用于活动列表/首页推荐',
109 109
       },
110 110
       {
111 111
         label: '拼团封面图2',
@@ -115,7 +115,7 @@ const Edit = props => {
115 115
         rules: [
116 116
           { required: true, message: '请输入拼团封面图2' },
117 117
         ],
118
-        help: '建议图片尺寸:750*250px,比例3:1,格式:jpg,用于首页底部活动轮播',
118
+        help: '建议图片尺寸:750*250px,比例3:1,格式:jpg,用于:项目详情页',
119 119
       },
120 120
       {
121 121
         label: '活动时间',
@@ -310,7 +310,7 @@ const Edit = props => {
310 310
           </div>
311 311
           <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
312 312
             <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报描述</p>
313
-            <TextArea rows={5} value={textAreaValue} onChange={e => changeTextArea(e.target.value)} />
313
+            <TextArea rows={5} maxLength={1024} value={textAreaValue} onChange={e => changeTextArea(e.target.value)} />
314 314
           </div>
315 315
 
316 316
         </div>
@@ -370,7 +370,7 @@ const Edit = props => {
370 370
         <div>
371 371
           <p style={{ display: 'flex', alignItems: 'center', fontSize: '14px', color: '#999', margin: '0', lineHeight: '0' }}><img src={logo} style={{ width: '22px', marginRight: '10px' }} />知与行互动</p>
372 372
           <p style={{ fontSize: '16px', color: '#222', fontWeight: '600', margin: '0' }}>{inputValue ? inputValue : '置业V客厅 精准获客平台'}</p>
373
-          <img style={{ width: '200px', height: '140px' }} src={imgValue ? imgValue : poster2} alt="" />
373
+          <img style={{ width: '200px', height: '160px' }} src={imgValue ? imgValue : poster2} alt="" />
374 374
         </div>
375 375
       </div>
376 376
       <div style={{ display: 'flex', alignItems: 'center', width: '100%' }}>

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

@@ -315,7 +315,7 @@ function body(props) {
315 315
   // 分页
316 316
   function onChange(pageNum) {
317 317
     // eslint-disable-next-line react-hooks/rules-of-hooks
318
-    getList({ pageNumber: pageNum, pageSize: 10, groupStatus })
318
+    getList({ pageNumber: pageNum, pageSize: 10, groupStatus, groupActivityId: groupActivityId, ...props.form.getFieldsValue() })
319 319
   }
320 320
 
321 321
   // 助力成功/进行中/助力失败
@@ -326,9 +326,9 @@ function body(props) {
326 326
     const { value } = e.target
327 327
     setgroupStatus(value)
328 328
     if (value == 0) { 
329
-        getList({ pageNumber: 1, pageSize: 10, groupStatus: value, groupActivityId: groupActivityId }) }
329
+        getList({ pageNumber: 1, pageSize: 10, groupStatus: value, groupActivityId: groupActivityId, ...props.form.getFieldsValue() }) }
330 330
     if (value == 1 || value == 2) {
331
-         getFailList({ pageNumber: 1, pageSize: 10, groupStatus: value, groupActivityId: groupActivityId })
331
+         getFailList({ pageNumber: 1, pageSize: 10, groupStatus: value, groupActivityId: groupActivityId, ...props.form.getFieldsValue() })
332 332
          }
333 333
   }
334 334
 

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

@@ -41,6 +41,24 @@ const header = props => {
41 41
     });
42 42
   }
43 43
 
44
+  const getActivityDetail = (groupActivityId) => () => {
45
+    router.push({
46
+      pathname: '/activity/groupActivity/detailActivity',
47
+      query: {
48
+        groupActivityId,
49
+      },
50
+    });
51
+  } 
52
+
53
+  const getJoinPeople = (groupActivityId) => () => {
54
+    router.push({
55
+      pathname: '/activity/groupActivity/helpRecord',
56
+      query: {
57
+          groupActivityId,
58
+      },
59
+    });
60
+  } 
61
+
44 62
   /**
45 63
    *
46 64
    *
@@ -54,6 +72,8 @@ const header = props => {
54 72
       dataIndex: 'activityName',
55 73
       key: 'activityName',
56 74
       align: 'center',
75
+      render:  (x, row) => <><div style={{overflow: 'hidden',textOverflow: 'ellipsis',whiteSpace: 'nowrap', width: '201px',title:'content'}}>
76
+                              <span style={{color: 'blue',cursor: 'pointer'}} onClick={getActivityDetail(row.groupActivityId)}>{row.activityName}</span></div></>,
57 77
     },
58 78
     {
59 79
       title: '活动时间',
@@ -73,6 +93,8 @@ const header = props => {
73 93
       dataIndex: 'participateNum',
74 94
       key: 'participateNum',
75 95
       align: 'center',
96
+      render: (x, row) => <><div style={{overflow: 'hidden',textOverflow: 'ellipsis',whiteSpace: 'nowrap', width: '201px',title:'content'}}>
97
+                            <span style={{color: 'blue',cursor: 'pointer'}} onClick={getJoinPeople(row.groupActivityId)}>{row.participateNum}</span></div></>,
76 98
     },
77 99
     {
78 100
       title: '成团数',
@@ -107,19 +129,16 @@ const header = props => {
107 129
           {row.activityStatus === 0 &&
108 130
             <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>
109 131
           }
110
-          {(row.activityStatus === 0 || row.activityStatus === 2)&&
111
-            <AuthButton name="admin.taShareSuccessRecord.get" noRight={null}>
112
-              <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={getSignList.bind(this, row.groupActivityId)}>拼团记录<Icon type="snippets" className={styles.shoppingCart} /></span>
113
-            </AuthButton>
114
-          }
115 132
           {
116
-            <AuthButton name="admin.buildingDynamic.send.dynamicId.put" noRight={null}>
133
+            <AuthButton name="admin.taShareActivity.publish" noRight={null}>
117 134
               <span style={{ color: '#1990FF',marginRight: '20px', cursor: 'pointer' }} onClick={sendOrPublicDynamic.bind(this, row)}>{row.status === 1 ? '取消发布' : '发布'}<Icon type="close-circle" className={styles.edit} /></span>
118 135
             </AuthButton>
119 136
           }
120 137
           {
121
-            <AuthButton name="admin.taShareActivity.list.get" noRight={null}>
138
+            <AuthButton name="admin.taShareActivity.tag" noRight={null}>
122 139
               <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>
140
+            </AuthButton>}{
141
+            <AuthButton name="admin.taShareActivity.top" noRight={null}>
123 142
               <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={recommendGroupActivity(row)}>{row.sort === true ? '取消推荐首页' : '推荐首页'}<Icon type="vertical-align-top" className={styles.edit} /></span>
124 143
             </AuthButton>}
125 144
 
@@ -132,15 +151,7 @@ const header = props => {
132 151
       ),
133 152
     },
134 153
   ];
135
-  const getSignList = groupActivityId => {
136
-    router.push({
137
-      pathname: '/activity/groupActivity/helpRecord',
138
-      query: {
139
-        groupActivityId,
140
-      },
141
-    });
142
-  }
143
-
154
+  
144 155
   const finishDynamic = (row) => {
145 156
     Modal.confirm({
146 157
       title: '结束以后将无法编辑, 是否继续?',
@@ -301,9 +312,11 @@ const header = props => {
301 312
           )}
302 313
         </Form.Item>
303 314
         <Form.Item>
315
+        <AuthButton name="admin.taShareActivity.search" noRight={null}>
304 316
           <Button type="primary" htmlType="submit" className={styles.searchBtn}>
305 317
             搜索
306 318
           </Button>
319
+          </AuthButton>
307 320
           <Button style={{ marginLeft: 8 }} onClick={handleReset}>
308 321
             重置
309 322
             </Button>
@@ -312,7 +325,13 @@ const header = props => {
312 325
       <AuthButton name="admin.taShareActivity.post" noRight={null}>
313 326
         <Button type="danger" className={styles.addBtn} onClick={toEditActivity()}>新增</Button>
314 327
       </AuthButton>
315
-      <Table style={{marginTop:'30px'}} dataSource={data.records} columns={columns} pagination={false} rowKey="activityList" />
328
+      <Table 
329
+      // onRow={record => {
330
+      //     return {
331
+      //       onClick: getActivityDetail(record.groupActivityId),
332
+      //     };
333
+      //   }}
334
+        style={{marginTop:'30px'}} dataSource={data.records} columns={columns} pagination={false} rowKey="activityList" />
316 335
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
317 336
         <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
318 337
       </div>

+ 397
- 0
src/pages/activity/helpActivity/detailActivity.jsx Прегледај датотеку

@@ -0,0 +1,397 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker, message, Upload } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import styles from '../../style/GoodsList.less';
5
+import apis from '../../../services/apis';
6
+import moment from 'moment';
7
+import router from 'umi/router';
8
+import BuildSelect from '../../../components/SelectButton/BuildSelect'
9
+import XForm, { FieldTypes } from '../../../components/XForm';
10
+import Wangedit from '../../../components/Wangedit/Wangedit'
11
+import request from '../../../utils/request'
12
+import yinhao from '../../../assets/yinhao.png'
13
+import ImageUploader from '../../../components/XForm/ImageUpload';
14
+import logo from '../../../assets/logo.png';
15
+import touxiang from '../../../assets/touxiang.jpg';
16
+import poster1 from '../../../assets/poster1.png';
17
+import poster2 from '../../../assets/poster2.png';
18
+import xiaochengxu from '../../../assets/xiaochengxu.png';
19
+import AuthButton from '@/components/AuthButton';
20
+
21
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
22
+const { TextArea } = Input;
23
+
24
+const formItemLayout = {
25
+  labelCol: { span: 6 },
26
+  wrapperCol: { span: 14 },
27
+};
28
+
29
+const cancelPage = () => {
30
+  router.push({
31
+    pathname: '/activity/helpActivity/list',
32
+  });
33
+}
34
+
35
+const getSignList = helpActivityId => {
36
+    router.push({
37
+        pathname: '/activity/helpActivity/signList',
38
+        query: {
39
+          helpActivityId,
40
+        },
41
+      });
42
+}
43
+
44
+const BasicForm = props => {
45
+
46
+  const detailData = props.detailData || {}
47
+  
48
+  const { helpActivityId } = props
49
+
50
+  const handleSubmit = e => {
51
+    e.preventDefault();
52
+    props.form.validateFields((err, values) => {
53
+      if (!err) {
54
+        console.log('Received values of form: ', values);
55
+        const { activityTime, signupTime } = values
56
+        const [startDate, endDate] = activityTime
57
+        values.startDate = moment(startDate).format('YYYY-MM-DD HH:mm');
58
+        values.endDate = moment(endDate).format('YYYY-MM-DD HH:mm');
59
+        if (signupTime) {
60
+          const [enlistStart, enlistEnd] = signupTime
61
+          values.enlistStart = moment(enlistStart).format('YYYY-MM-DD HH:mm');
62
+          values.enlistEnd = moment(enlistEnd).format('YYYY-MM-DD HH:mm');
63
+        }
64
+        
65
+        console.log('submit data --->', values)
66
+        if (helpActivityId) {
67
+          values.helpActivityId = helpActivityId
68
+          request({ ...apis.helpActivity.update, data: values }).then(data => {
69
+            message.info('保存成功')
70
+            // router.go(-1)
71
+          }).catch((err) => {
72
+            message.info(err.msg || err.message)
73
+          })
74
+        } else {
75
+          request({ ...apis.helpActivity.add, data: { ...values } }).then((data) => {
76
+            message.info('保存成功')
77
+            router.push({
78
+              pathname: '/activity/helpActivity/edithelpActivity',
79
+              query: {
80
+                helpActivityId: data.helpActivityId,
81
+              },
82
+            });
83
+            // router.go(-1)
84
+          }).catch((err) => {
85
+            message.info(err.msg || err.message)
86
+          })
87
+        }
88
+      }
89
+    });
90
+  }
91
+
92
+  const { getFieldDecorator } = props.form;
93
+  return (
94
+    <>
95
+      <Form {...formItemLayout} onSubmit={handleSubmit}>
96
+        <Form.Item label="所属项目">
97
+        {getFieldDecorator('buildingId', {
98
+          initialValue: detailData.buildingId,
99
+          rules: [
100
+            {
101
+              required: true,
102
+              message: '请选择所属项目',
103
+            },
104
+          ],
105
+        })(<BuildSelect disabled/>)}
106
+        </Form.Item>
107
+        <Form.Item label="活动标题">
108
+          <span>{detailData.title}</span>
109
+        </Form.Item>
110
+        <Form.Item label="助力详情主图">
111
+          <img src={detailData.img} height="300px" width="375px" />
112
+        </Form.Item>
113
+        <Form.Item label="助力封面图1">
114
+           <img src={detailData.listImg} height="210px" width="375px" />
115
+        </Form.Item>
116
+        <Form.Item label="助力封面图2">
117
+          <img src={detailData.bannerListImg} height="125px" width="375px" />
118
+        </Form.Item>
119
+        <Form.Item label="助力邀请人数">
120
+          <span>{detailData.personNum}</span>
121
+        </Form.Item>
122
+        <Form.Item label="助力次数">
123
+          <span>{detailData.helpNum === 0 ? '不限' : detailData.helpNum}</span>
124
+        </Form.Item>
125
+        <Form.Item label="活动时间">
126
+          <span>{`${moment(detailData.startDate).format('YYYY-MM-DD HH:mm:ss')} —— ${moment(detailData.endDate).format('YYYY-MM-DD HH:mm:ss')}`}</span>
127
+        </Form.Item>
128
+        <Form.Item label="活动说明">
129
+          <img src={detailData.activityInstructions} height="300px" width="375px" />
130
+        </Form.Item>
131
+        <Form.Item label="权重">
132
+          <span>{detailData.heavy}</span>
133
+        </Form.Item>
134
+      </Form>
135
+    </>
136
+  )
137
+}
138
+
139
+const Basic = Form.create({ name: 'BasicForm' })(BasicForm);
140
+
141
+/**
142
+ *
143
+ *
144
+ * @param {*} props
145
+ * @returns
146
+ */
147
+const Edit = props => {
148
+  const [tab, changeTab] = useState('basic')
149
+  const { helpActivityId } = props.location.query
150
+  const [detailData, setDetailData] = useState(false)
151
+
152
+  const getDynamicData = helpActivityId => {
153
+    
154
+    request({ ...apis.helpActivity.details, params: { helpActivityId } }).then((data) => {
155
+      console.log(data)
156
+      data.activityTime = [moment(data.startDate), moment(data.endDate)]
157
+      data.signupTime = [moment(data.enlistStart), moment(data.enlistEnd)]
158
+
159
+      setDetailData(data)
160
+    })
161
+  }
162
+
163
+  useEffect(() => {
164
+    
165
+    if (helpActivityId) {
166
+      
167
+      getDynamicData(helpActivityId);
168
+    }
169
+  }, [])
170
+
171
+  const Poster = (props) => {
172
+    const [inputValue, changeInput] = useState('')
173
+    const [textAreaValue, changeTextArea] = useState('')
174
+    const [imgValue, changeImg] = useState('')
175
+    const [posterId, setPosterId] = useState('')
176
+
177
+    if (helpActivityId) {
178
+      console.log(helpActivityId, 'helpActivityId')
179
+      useEffect(() => {
180
+        request({ ...apis.activity.poster, params: { targetId: helpActivityId, targetType: 'helpActivity' } }).then((data) => {
181
+          console.log(data, "2222")
182
+          if (data.length > 0) {
183
+            setPosterId(data[0].posterId)
184
+            changeImg(data[0].posterImg)
185
+            changeTextArea(data[0].posterDescription)
186
+            changeInput(data[0].posterTitle)
187
+          }
188
+        }).catch((err) => {
189
+          message.info(err.msg || err.message)
190
+        })
191
+        getMiniappName()
192
+      }, [])
193
+    }else{
194
+      getMiniappName()
195
+    }
196
+    // 获取小程序名称
197
+    const [miniappName, setMiniappName] = useState('')
198
+    function getMiniappName() {
199
+      request({ ...apis.building.getMiniappName }).then(res => {
200
+        console.log(res, "0000000000000")
201
+        setMiniappName(res)
202
+      })
203
+    }
204
+
205
+    const submitPoster = () => {
206
+      if (helpActivityId) {
207
+        if (posterId) {
208
+          request({ ...apis.activity.updatePoster, urlData: { id: posterId }, data: { targetId: helpActivityId, targetType: 'helpActivity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
209
+            message.info("保存成功")
210
+          }).catch((err) => {
211
+            message.info(err.msg || err.message)
212
+          })
213
+        } else {
214
+          request({ ...apis.activity.addPoster, data: { targetId: helpActivityId, targetType: 'helpActivity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
215
+            setPosterId(data.posterId)
216
+            message.info("保存成功")
217
+          }).catch((err) => {
218
+            message.info(err.msg || err.message)
219
+          })
220
+        }
221
+      } else {
222
+        message.warn("请先保存基本信息数据")
223
+      }
224
+    }
225
+
226
+    return <div>
227
+      <div style={{ display: 'flex' }}>
228
+        <div style={{ width: '420px', height: '900px', display: 'inline-block', marginTop: '30px' }}>
229
+          <div style={{ width: '375px', height: '700px', backgroundColor: '#fff', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
230
+            <img style={{ width: '100%', height: '300px' }} src={imgValue ? imgValue : poster1} alt="" />
231
+            <div style={{ display: 'flex', alignItems: 'center', marginTop: '-24px' }}>
232
+              <img style={{ width: '70px', height: '70px', border: '4px solid #fff', borderRadius: '35px', marginLeft: '16px' }} src={touxiang} alt="" />
233
+              <span style={{ color: '#222', fontWeight: '600', margin: '24px 10px 0 14px', fontSize: '17px' }}>喵喵</span>
234
+              <span style={{ color: '#999', marginTop: '25px', fontSize: '17px' }}>邀您参与</span>
235
+              <span style={{ color: '#999', margin: '25px 0 0 60px', fontSize: '17px' }}>2019.09.21</span>
236
+            </div>
237
+            <p style={{
238
+              margin: '10px 20px',
239
+              fontSize: '20px',
240
+              color: '#222',
241
+              fontWeight: '600',
242
+              display: '-webkit-box',
243
+              lineClamp: '3',
244
+              height: '60px',
245
+              WebkitLineClamp: '2',
246
+              WebkitBoxOrient: 'vertical',
247
+              overflow: 'hidden',
248
+              textOverflow: 'ellipsis'
249
+            }}>{inputValue ? inputValue : '海报标题'}</p>
250
+
251
+            <img src={yinhao} style={{ width: '30px', marginLeft: '20px' }} alt="" />
252
+            <p style={{
253
+              margin: '16px 20px 28px 20px',
254
+              fontSize: '17px',
255
+              color: '#999',
256
+              display: '-webkit-box',
257
+              lineClamp: '3',
258
+              height: '72px',
259
+              WebkitLineClamp: '3',
260
+              WebkitBoxOrient: 'vertical',
261
+              overflow: 'hidden',
262
+              textOverflow: 'ellipsis'
263
+            }}>{textAreaValue ? textAreaValue : '海报描述'}</p>
264
+            <div style={{ backgroundColor: '#f1f1f1', padding: '22px 30px', boxShadow: '0px 6px 12px -4px #dcdcdc', position: 'relative' }}>
265
+              <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>长按识别小程序码</p>
266
+              <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>进入<span style={{ margin: '0 5px', fontSize: '18px', color: '#333', fontWeight: '600' }}>{miniappName || '置业V顾问'}</span>报名活动</p>
267
+              <img style={{ width: '80px', position: 'absolute', right: '30px', top: '10px' }} src={xiaochengxu} alt="" />
268
+            </div>
269
+          </div>
270
+          <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
271
+        </div>
272
+
273
+        {/* <div >
274
+          <div style={{ display: 'flex', width: '100%', margin: '60px 0' }}>
275
+            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>活动海报图</p>
276
+            <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
277
+          </div>
278
+          <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:640*670px,比例64:67,格式:jpg,用于普通活动海报</p>
279
+          <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
280
+            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
281
+            <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
282
+          </div>
283
+          <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
284
+            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报描述</p>
285
+            <TextArea rows={5} value={textAreaValue} onChange={e => changeTextArea(e.target.value)} />
286
+          </div>
287
+
288
+        </div> */}
289
+      </div>
290
+      {/* <Button type="primary" onClick={submitPoster} style={{ margin: '40px 40px 40px 30vw' }}> 确定</Button>
291
+      <Button onClick={() => cancelPage()}>
292
+        取消
293
+      </Button> */}
294
+    </div>
295
+
296
+  }
297
+
298
+
299
+
300
+  const Share = (props) => {
301
+    const [inputValue, changeInput] = useState('')
302
+    const [imgValue, changeImg] = useState('')
303
+    const [shareContentId, setShareContentId] = useState('')
304
+
305
+    if (helpActivityId) {
306
+      useEffect(() => {
307
+        request({ ...apis.activity.shareContent, params: { targetId: helpActivityId, targetType: 'helpActivity' }, }).then((data) => {
308
+          console.log(data, "2222")
309
+          if (data.length > 0) {
310
+            setShareContentId(data[0].shareContentId)
311
+            changeImg(data[0].shareContentImg)
312
+            changeInput(data[0].shareContentTitle)
313
+          }
314
+        }).catch((err) => {
315
+          message.info(err.msg || err.message)
316
+        })
317
+      }, [])
318
+    }
319
+
320
+    const submitShare = () => {
321
+      if (helpActivityId) {
322
+        if (shareContentId) {
323
+          request({ ...apis.activity.updateShareContent, urlData: { id: shareContentId }, data: { targetId: helpActivityId, shareContentType: 'helpActivity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
324
+            message.info("保存成功")
325
+          }).catch((err) => {
326
+            message.info(err.msg || err.message)
327
+          })
328
+        } else {
329
+          request({ ...apis.activity.addShareContent, data: { targetId: helpActivityId, shareContentType: 'helpActivity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
330
+            setShareContentId(data.shareContentId)
331
+            message.info("保存成功")
332
+          }).catch(err => {
333
+            message.info(err.msg || err.message)
334
+          })
335
+        }
336
+      } else {
337
+        message.warn("请先保存基本信息数据")
338
+      }
339
+    }
340
+
341
+    return <div style={{ padding: '20px' }}>
342
+      <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
343
+        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享模板</p>
344
+        <div>
345
+          <p style={{ display: 'flex', alignItems: 'center', fontSize: '14px', color: '#999', margin: '0', lineHeight: '0' }}><img src={logo} style={{ width: '22px', marginRight: '10px' }} />知与行互动</p>
346
+          <p style={{ fontSize: '16px', color: '#222', fontWeight: '600', margin: '0' }}>{inputValue ? inputValue : '置业V客厅 精准获客平台'}</p>
347
+          <img style={{ width: '200px', height: '160px' }} src={imgValue ? imgValue : poster2} alt="" />
348
+        </div>
349
+      </div>
350
+      <div style={{ display: 'flex', alignItems: 'center', width: '100%' }}>
351
+        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享标题</p>
352
+        {inputValue === '' ? '无' : <span>{inputValue}</span>}
353
+      </div>
354
+      <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
355
+        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>活动分享图</p>
356
+        {imgValue === '' ? '无':<img src={imgValue} height="120px" height="150px" />}
357
+      </div>
358
+      {/* <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
359
+      <Button onClick={() => cancelPage()}>
360
+        取消
361
+      </Button> */}
362
+    </div>
363
+  }
364
+
365
+  return (
366
+    <div>
367
+      <div>
368
+        <Radio.Group value={tab} buttonStyle="solid" onChange={e => changeTab(e.target.value)}>
369
+          <Radio.Button value="basic">基本信息</Radio.Button>
370
+          <Radio.Button value="poster">海报图片</Radio.Button>
371
+          <Radio.Button value="share">分享设置</Radio.Button>
372
+        </Radio.Group>
373
+      </div>
374
+      <div>
375
+        {tab === 'basic' && <Basic helpActivityId={helpActivityId} detailData={detailData}/>}
376
+        {tab === 'poster' && <Poster />}
377
+        {tab === 'share' && <Share />}
378
+      </div>
379
+      <div style={{textAlign: 'center'}}>
380
+        <AuthButton name="admin.help.record" noRight={null}>
381
+          {(detailData.activityStatus === 0 || detailData.activityStatus === 2) && 
382
+            <span 
383
+              style={{ color: '#1990FF',marginRight: '20px', cursor: 'pointer' }} 
384
+              onClick={getSignList.bind(this, detailData.helpActivityId)}>
385
+              <Button>助力记录</Button>
386
+            </span>}
387
+          </AuthButton>
388
+          <Button onClick={() => cancelPage()}>
389
+            取消
390
+          </Button>
391
+      </div>
392
+
393
+    </div>
394
+  );
395
+}
396
+
397
+export default Edit

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

@@ -165,7 +165,7 @@ const header = props => {
165 165
         })(<Input />)}
166 166
         </Form.Item>
167 167
 
168
-        <Form.Item label="助力详情主图" help="建议图片尺寸:750*600px,比例5:4,格式:jpg,用于助力活动详情">
168
+        <Form.Item label="助力详情主图" help="建议图片尺寸:750*600px,比例5:4,格式:jpg,用于助力活动详情">
169 169
           {getFieldDecorator('img', {
170 170
           rules: [
171 171
             {
@@ -176,7 +176,7 @@ const header = props => {
176 176
         })(<ImageUploader />)}
177 177
         </Form.Item>
178 178
 
179
-        <Form.Item label="助力封面图1" help="建议图片尺寸:750*420px,比例16:9,格式:jpg,用于活动列表">
179
+        <Form.Item label="助力封面图1" help="建议图片尺寸:750*420px,比例16:9,格式:jpg,用于活动列表/首页推荐">
180 180
           {getFieldDecorator('listImg', {
181 181
           rules: [
182 182
             {
@@ -187,7 +187,7 @@ const header = props => {
187 187
         })(<ImageUploader />)}
188 188
         </Form.Item>
189 189
 
190
-        <Form.Item label="助力封面图2" help="建议图片尺寸:750*250px,比例3:1,格式:jpg,用于首页底部活动轮播">
190
+        <Form.Item label="助力封面图2" help="建议图片尺寸:750*250px,比例3:1,格式:jpg,用于:项目详情页">
191 191
           {getFieldDecorator('bannerListImg', {
192 192
           rules: [
193 193
             {
@@ -423,7 +423,7 @@ const Edit = props => {
423 423
           </div>
424 424
           <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
425 425
             <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报描述</p>
426
-            <TextArea rows={5} value={textAreaValue} onChange={e => changeTextArea(e.target.value)} />
426
+            <TextArea rows={5} maxLength={1024} value={textAreaValue} onChange={e => changeTextArea(e.target.value)} />
427 427
           </div>
428 428
 
429 429
         </div>
@@ -483,7 +483,7 @@ const Edit = props => {
483 483
         <div>
484 484
           <p style={{ display: 'flex', alignItems: 'center', fontSize: '14px', color: '#999', margin: '0', lineHeight: '0' }}><img src={logo} style={{ width: '22px', marginRight: '10px' }} />知与行互动</p>
485 485
           <p style={{ fontSize: '16px', color: '#222', fontWeight: '600', margin: '0' }}>{inputValue ? inputValue : '置业V客厅 精准获客平台'}</p>
486
-          <img style={{ width: '200px', height: '140px' }} src={imgValue ? imgValue : poster2} alt="" />
486
+          <img style={{ width: '200px', height: '160px' }} src={imgValue ? imgValue : poster2} alt="" />
487 487
         </div>
488 488
       </div>
489 489
       <div style={{ display: 'flex', alignItems: 'center', width: '100%' }}>

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

@@ -525,13 +525,11 @@ function helpRecord(row) {
525 525
       </Button>
526 526
 
527 527
       <div style={{ margin: '20px 0' }}>
528
-        <AuthButton name="admin.customer.recommend.get" noRight={null}>
529 528
           <Radio.Group value={customerType} onChange={radioButtonHandleSizeChange} buttonStyle="solid">
530 529
             <Radio.Button value="helpSucceed">助力成功</Radio.Button>
531 530
             <Radio.Button value="helpUnderway">进行中</Radio.Button>
532 531
             <Radio.Button value="helpUnfinished">助力失败</Radio.Button>
533 532
           </Radio.Group>
534
-        </AuthButton>
535 533
       </div>
536 534
       {customerType === 'helpSucceed' ?
537 535
         <Table dataSource={dataSource.list} columns={privateColumns} pagination={{ total: dataSource.total, onChange }} rowKey="customerList" /> :

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

@@ -40,6 +40,25 @@ const toEditGoods = (helpActivityId) => () => {
40 40
     });
41 41
   }
42 42
   
43
+const getActivityDetail = (helpActivityId) => () => {
44
+  router.push({
45
+    pathname: '/activity/helpActivity/detailActivity',
46
+    query: {
47
+      helpActivityId,
48
+    },
49
+  });
50
+}
51
+
52
+const getJoinPeople = (helpActivityId) => () => {
53
+  router.push({
54
+    pathname: '/activity/helpActivity/helpRecord',
55
+    query: {
56
+      helpActivityId,
57
+    },
58
+  });
59
+}
60
+  
61
+  
43 62
   /**
44 63
    *
45 64
    *
@@ -53,6 +72,8 @@ const toEditGoods = (helpActivityId) => () => {
53 72
       dataIndex: 'title',
54 73
       key: 'title',
55 74
       align: 'center',
75
+      render:  (x, row) => <><div style={{overflow: 'hidden',textOverflow: 'ellipsis',whiteSpace: 'nowrap', width: '201px',title:'content'}}>
76
+                              <span style={{color: 'blue',cursor: 'pointer'}} onClick={getActivityDetail(row.helpActivityId)}>{row.title}</span></div></>,
56 77
     },
57 78
     {
58 79
       title: '活动时间',
@@ -66,6 +87,8 @@ const toEditGoods = (helpActivityId) => () => {
66 87
       dataIndex: 'enlistNum',
67 88
       key: 'enlistNum',
68 89
       align: 'center',
90
+      render:  (x, row) => <><div style={{overflow: 'hidden',textOverflow: 'ellipsis',whiteSpace: 'nowrap', width: '201px',title:'content'}}>
91
+                              <span style={{color: 'blue',cursor: 'pointer'}} onClick={getJoinPeople(row.helpActivityId)}>{row.enlistNum}</span></div></>,
69 92
     },
70 93
     {
71 94
       title: '助力成功数',
@@ -97,22 +120,20 @@ const toEditGoods = (helpActivityId) => () => {
97 120
       align: 'center',
98 121
       render: (x, row) => (
99 122
         <>
100
-          {(row.activityStatus === 0 || row.activityStatus === 2) &&
101
-          <AuthButton name="admin.helpRecord.get">
102
-             <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={ getSignList.bind(this, row.helpActivityId)}>助力记录<Icon type="snippets" style={{color:'#bebebe'}}   className={styles.shoppingCart} /></span>
103
-          </AuthButton>}
104 123
           {
105
-            <AuthButton name="admin.top.update.post" noRight={null}>
124
+            <AuthButton name="admin.help.publish" noRight={null}>
106 125
               <span style={{ color: '#1990FF',marginRight: '20px', cursor: 'pointer' }} onClick={sendOrPublicDynamic.bind(this, row)}>{row.status === 1 ? '取消发布' : '发布'}<Icon type="close-circle" className={styles.edit} /></span>
107 126
             </AuthButton>
108 127
           }
109 128
           {row.activityStatus === 0 &&
110
-            <AuthButton name="admin.top.update.post" noRight={null}>
129
+            <AuthButton name="admin.help.finish" noRight={null}>
111 130
             <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 2)}>结束活动<Icon type="poweroff" style={{color:'#bebebe'}} className={styles.edit} /></span> </AuthButton>
112 131
           }
113 132
           {
114
-          <AuthButton name="admin.top.update.post" noRight={null}>
133
+          <AuthButton name="admin.help.tag" noRight={null}>
115 134
             <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>
135
+          </AuthButton>}{
136
+          <AuthButton name="admin.help.top" noRight={null}>
116 137
             <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>
117 138
           </AuthButton> }
118 139
 
@@ -285,18 +306,26 @@ const handleSubmit = (e, props) => {
285 306
           )}
286 307
         </Form.Item>
287 308
         <Form.Item>
309
+        <AuthButton name="admin.help.search" noRight={null}>
288 310
           <Button type="primary" htmlType="submit" className={styles.searchBtn}>
289 311
             搜索
290 312
           </Button>
313
+          </AuthButton>
291 314
           <Button style={{ marginLeft: 8 }} onClick={handleReset}>
292 315
               重置
293 316
             </Button>
294 317
         </Form.Item>
295 318
       </Form>
296
-      <AuthButton name="admin.buildingDynamic.add.post" noRight={null}>
319
+      <AuthButton name="admin.help.add.post" noRight={null}>
297 320
         <Button name="admin.helpActivity.add.post" noRight={null} type="danger" className={styles.addBtn} onClick={toEditGoods()}>新增</Button>
298 321
       </AuthButton>
299
-      <Table dataSource={data.records} columns={columns} pagination={false} rowKey="activityList"/>
322
+      <Table 
323
+        // onRow={record => {
324
+        //   return {
325
+        //     onClick: getActivityDetail(record.helpActivityId),
326
+        //   };
327
+        // }}
328
+      dataSource={data.records} columns={columns} pagination={false} rowKey="activityList"/>
300 329
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
301 330
         <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current}/>
302 331
       </div>

+ 546
- 0
src/pages/activity/helpActivity/signList.jsx Прегледај датотеку

@@ -0,0 +1,546 @@
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, message } from 'antd';
3
+import moment from 'moment';
4
+import request from '../../../utils/request';
5
+import apis from '../../../services/apis';
6
+import router from 'umi/router';
7
+import BuildSelect from '../../../components/SelectButton/BuildSelect'
8
+import AuthButton from '@/components/AuthButton';
9
+
10
+
11
+const { Option } = Select;
12
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
13
+const { Meta } = Card;
14
+
15
+/**
16
+ * 助力者弹框
17
+ */
18
+class InviteTable extends React.Component {
19
+  constructor(props) {
20
+    super(props);
21
+    this.state = {
22
+      dataSource: { records: [] },
23
+      visibleData: { visible: false, helpId: '', realtyConsultant: '' },
24
+    }
25
+  }
26
+
27
+  // 挂载之后
28
+  componentDidMount () {
29
+    const { helpId } = this.state.visibleData
30
+    this.getList({ helpRecordInitiateId: helpId, pageNumber: 1, pageSize: 5 })
31
+  }
32
+
33
+  componentDidUpdate (preProps, preState) {
34
+    const { helpId } = this.state.visibleData
35
+    if (this.props.visibleData.visible !== preState.visibleData.visible) {
36
+      this.getList({ helpRecordInitiateId: helpId, 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, helpId: '', realtyConsultant: '' } })
45
+    this.props.onCancel()
46
+  }
47
+
48
+  // 弹框取消按钮
49
+  handleCancel () {
50
+    this.setState({ visibleData: { visible: false, helpId: '', realtyConsultant: '' } })
51
+    this.props.onCancel()
52
+  }
53
+
54
+  getList (params) {
55
+    if (params.helpRecordInitiateId === '') {
56
+      return
57
+    }
58
+    request({ ...apis.helpActivity.helpPeopleDetails, params: { ...params } }).then(res => {
59
+      this.setState({ dataSource: res })
60
+    }).catch(err => {
61
+      // eslint-disable-next-line no-unused-expressions
62
+      <Alert
63
+        style={{
64
+          marginBottom: 24,
65
+        }}
66
+        message={err}
67
+        type="error"
68
+        showIcon
69
+      />
70
+    })
71
+  }
72
+
73
+  // eslint-disable-next-line class-methods-use-this
74
+  exportHelp() {
75
+    request({ ...apis.helpActivity.gethelpRecordExport, responseType: 'blob', params: { helpRecordInitiateId: this.state.visibleData.helpId } })
76
+      .then(data => {
77
+        if (!data) {
78
+          return
79
+        }
80
+        const url = window.URL.createObjectURL(new Blob([data]))
81
+        const link = document.createElement('a')
82
+        link.style.display = 'none'
83
+        link.href = url
84
+        link.setAttribute('download', '助力者记录.xlsx')
85
+        document.body.append(link)
86
+        link.click()
87
+      }).catch(() => {
88
+
89
+      })
90
+  }
91
+
92
+
93
+  // 分页
94
+  // eslint-disable-next-line react/sort-comp
95
+  onChange (pageNum) {
96
+    this.getList({ pageNumber: pageNum, pageSize: 5 })
97
+  }
98
+
99
+  render () {
100
+    const columns = [
101
+      {
102
+        title: '用户姓名',
103
+        dataIndex: 'name',
104
+        key: 'name',
105
+        align: 'center',
106
+      },
107
+      {
108
+        title: '手机号',
109
+        dataIndex: 'phone',
110
+        key: 'phone',
111
+        align: 'center',
112
+        render: text => <a>{text}</a>,
113
+      },
114
+      {
115
+        title: '助力时间',
116
+        dataIndex: 'createDate',
117
+        key: 'createDate',
118
+        align: 'center',
119
+        render: (x, row) => <><span>{`${moment(row.createDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
120
+      },
121
+    ]
122
+    return (
123
+      <>
124
+        <Modal
125
+          title="助力者"
126
+          destroyOnClose="true"
127
+          width={900}
128
+          footer={null}
129
+          visible={this.state.visibleData.visible}
130
+          // onOk={() => this.handleOk()}
131
+          onCancel={e => this.handleCancel(e)}
132
+        >
133
+
134
+      <Button name="admin.HelpInitiateRecordSucceed.export.get" noRight={null} type="primary" onClick={() => this.exportHelp()} style={{ float: 'right', margin: '20px 0', zIndex: 1 }}>
135
+        导出
136
+      </Button>
137
+          <Table rowKey="independent" dataSource={this.state.dataSource.records} columns={columns} pagination={{ total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
138
+        </Modal>
139
+      </>
140
+    );
141
+  }
142
+}
143
+
144
+
145
+/**
146
+ * 核销弹框
147
+ */
148
+class Verifier extends React.Component {
149
+  constructor(props) {
150
+    super(props);
151
+    this.state = {
152
+      verification: { verificationCode: '' },
153
+      visibleData: { visible: false, helpId: '', helpActivityId: '', helpRecordInitiateId: '', verificationCode: '' },
154
+    }
155
+  }
156
+
157
+  // 挂载之后
158
+  componentDidMount () {
159
+    const { helpId } = this.state.visibleData
160
+  }
161
+
162
+  componentDidUpdate (preProps, preState) {
163
+    const { helpId } = this.state.visibleData
164
+    if (this.props.visibleData.visible !== preState.visibleData.visible) {
165
+      // eslint-disable-next-line react/no-did-update-set-state
166
+      this.setState({ visibleData: { ...this.props.visibleData } })
167
+    }
168
+  }
169
+
170
+  // 弹框确定按钮
171
+  // eslint-disable-next-line react/sort-comp
172
+  handleOk () {
173
+    this.setState({ visibleData: { visible: false, helpId: '', helpRecordInitiateId: '', verificationCode: '' } })
174
+  }
175
+
176
+  // 弹框取消按钮
177
+  handleCancel () {
178
+    console.log('核销关闭');
179
+    // this.setState({ visibleData: { visible: false, helpId: '', helpRecordInitiateId: '', verificationCode: '' } })
180
+    this.props.onCancel()
181
+  }
182
+
183
+  // eslint-disable-next-line class-methods-use-this
184
+  audit (params) {
185
+    request({ ...apis.helpActivity.verification, params: { ...params } }).then(res => {
186
+      // eslint-disable-next-line no-undef
187
+      message.info('核销成功')
188
+      this.props.onSuccess({ pageNumber: 1, pageSize: 10, helpActivityId: this.props.visibleData.helpActivityId, status: 'helpSucceed' })
189
+    }).catch(err => {
190
+      // eslint-disable-next-line no-unused-expressions
191
+      <Alert
192
+        style={{
193
+          marginBottom: 24,
194
+        }}
195
+        message={err}
196
+        type="error"
197
+        showIcon
198
+      />
199
+    })
200
+  }
201
+
202
+  // eslint-disable-next-line class-methods-use-this
203
+  verify(e) {
204
+    this.setState({ visibleData: { visible: true, helpId: this.props.visibleData.helpId, verificationCode: e.target.value } })
205
+  }
206
+
207
+  // eslint-disable-next-line class-methods-use-this
208
+  verification(e) {
209
+    this.audit({ helpRecordInitiateId: this.state.visibleData.helpId, verifyCode: this.state.visibleData.verificationCode })
210
+  }
211
+
212
+  render () {
213
+    return (
214
+      <>
215
+        <Modal
216
+          title="核销"
217
+          destroyOnClose="true"
218
+          width={300}
219
+          footer={null}
220
+          visible={this.state.visibleData.visible}
221
+          // onOk={() => this.handleOk()}
222
+          onCancel={e => this.handleCancel(e)}
223
+        >
224
+          <div><span>核销码:<input style={{marginLeft: '10px'}} onChange={this.verify.bind(this)}/></span>
225
+           <Button name="admin.helpInitiateRecordVerify.post" noRight={null} onClick={e => this.verification(e)} style={{ marginLeft: '80px', marginTop:'10px', backgroundColor:'red' }}><span style={{color:'white'}}>立即核销</span></Button>
226
+          </div>
227
+        </Modal>
228
+      </>
229
+    );
230
+  }
231
+}
232
+
233
+/**
234
+ *主体列表
235
+ *
236
+ * @param {*} props
237
+ * @returns
238
+ */
239
+function body(props) {
240
+  // eslint-disable-next-line react-hooks/rules-of-hooks
241
+  const [gInviteData, setGInviteData] = useState({ visible: false, helpId: '', realtyConsultant: '' })
242
+
243
+  // 核销码弹框
244
+  // eslint-disable-next-line react-hooks/rules-of-hooks
245
+  const [gVerifierData, setVerifierData] = useState({ visible: false, helpId: '', helpActivityId: '', helpRecordInitiateId: '', verificationCode: '' })
246
+
247
+  const { getFieldDecorator, getFieldsValue } = props.form
248
+
249
+  // eslint-disable-next-line react-hooks/rules-of-hooks
250
+  const [dataSource, setDataSource] = useState({ records: [] })
251
+  // eslint-disable-next-line react-hooks/rules-of-hooks
252
+  // const [columns, setColumns] = useState(privateColumns)
253
+
254
+  // 默认成功
255
+  // eslint-disable-next-line react-hooks/rules-of-hooks
256
+  const [customerType, setCustomerType] = useState('helpSucceed')
257
+
258
+  // 调整归属 ============  start
259
+  // eslint-disable-next-line react-hooks/rules-of-hooks
260
+  const [gVisibleData, setGVisibleData] = useState({ visible: false, helpId: '', realtyConsultant: '' })
261
+
262
+
263
+  // 变更状态 ============= end
264
+
265
+  // eslint-disable-next-line react-hooks/rules-of-hooks
266
+  const { helpActivityId } = props.location.query
267
+  useEffect(() => {
268
+    console.log('customerType', customerType)
269
+    getList({ pageNumber: 1, pageSize: 10, status: customerType, helpActivityId })
270
+  }, [])
271
+
272
+  function getList(params) {
273
+    // 网路请求
274
+    request({ ...apis.helpActivity.record, params: { ...params } }).then(res => {
275
+      setDataSource(res)
276
+    }).catch(err => {
277
+      // eslint-disable-next-line no-unused-expressions
278
+      <Alert
279
+        style={{
280
+          marginBottom: 24,
281
+        }}
282
+        message={err}
283
+        type="error"
284
+        showIcon
285
+      />
286
+    })
287
+  }
288
+
289
+  function displayNone() {
290
+    setGVisibleData({ visible: false, helpId: '', realtyConsultant: '' })
291
+  }
292
+
293
+  // 提交事件
294
+  function handleSubmit(e) {
295
+    // displayNone()
296
+
297
+
298
+    e.preventDefault();
299
+    props.form.validateFields((err, values) => {
300
+      if (!err) {
301
+        getList({ pageNum: 1, pageSize: 10, status: customerType, ...values, helpActivityId })
302
+      }
303
+    });
304
+  }
305
+
306
+  // Change 事件
307
+  function handleSelectChange(e) {
308
+    // eslint-disable-next-line no-console
309
+    console.log(e)
310
+  }
311
+
312
+  // 分页
313
+  function onChange(pageNum) {
314
+    // eslint-disable-next-line react-hooks/rules-of-hooks
315
+    getList({ pageNumber: pageNum, pageSize: 10, customerType })
316
+  }
317
+
318
+  // 助力成功/进行中/助力失败
319
+  function radioButtonHandleSizeChange(e) {
320
+    setGInviteData({ visible: false, helpId: '', realtyConsultant: '' })
321
+    setVerifierData({ visible: false, helpId: '', helpRecordInitiateId: '', verificationCode: '' })
322
+    // displayNone()
323
+
324
+    const { value } = e.target
325
+    setCustomerType(value)
326
+    // setColumns(value === 'helpSucceed' ? privateColumns : publicColumns)
327
+    getList({ pageNumber: 1, pageSize: 10, status: value, helpActivityId })
328
+  }
329
+
330
+  function handleReset() {
331
+    props.form.resetFields();
332
+    getList({ pageNum: 1, pageSize: 10, status: customerType, helpActivityId })
333
+  }
334
+
335
+  function toCustomerDateil(record) {
336
+    router.push({
337
+      pathname: '/customer/customerlist/customerDetail',
338
+      query: {
339
+        id: record.customerId,
340
+      },
341
+    });
342
+  }
343
+
344
+  function exportCustomer () {
345
+    const fieldsValue = getFieldsValue()
346
+    request({ ...apis.helpActivity.HelpInitiateRecordSucceed, responseType: 'blob', params: { ...fieldsValue, customerType, helpActivityId, condition: customerType } })
347
+      .then(response => {
348
+        download(response)
349
+      }).catch(error => {
350
+
351
+      })
352
+  }
353
+
354
+  function download (data) {
355
+    if (!data) {
356
+      return
357
+    }
358
+    const url = window.URL.createObjectURL(new Blob([data]))
359
+    const link = document.createElement('a')
360
+    link.style.display = 'none'
361
+    link.href = url
362
+    link.setAttribute('download', '助力记录.xlsx')
363
+    document.body.append(link)
364
+    link.click()
365
+  }
366
+
367
+// 助力记录弹框
368
+function helpRecord(row) {
369
+  setVerifierData({ visible: false, helpId: row.helpRecordInitiateId, elpRecordInitiateId: '', verificationCode: '' })
370
+  setGInviteData({ visible: true, helpId: row.helpRecordInitiateId, realtyConsultant: row.realtyConsultant })
371
+}
372
+ // 核销
373
+ function helpInitiateRecordVerify(row) {
374
+// 关闭助力记录弹框
375
+  setGInviteData({ visible: false, helpId: row.helpRecordInitiateId, realtyConsultant: row.realtyConsultant })
376
+
377
+  // 核销
378
+  setVerifierData({ visible: true, helpId: row.helpRecordInitiateId, helpActivityId: row.helpActivityId, elpRecordInitiateId: '', verificationCode: '' })
379
+ }
380
+ // 核销回调
381
+ function onSuccess(e) {
382
+   console.log('回调:', e)
383
+   getList(e)
384
+    
385
+   // 关闭
386
+   onCancel()
387
+ }
388
+
389
+ function onCancel(e) {
390
+  // 核销
391
+  setVerifierData({ visible: false, helpId: '', helpActivityId: '', elpRecordInitiateId: '', verificationCode: '' })
392
+  // 助力者
393
+  setGInviteData({ visible: false, helpId: '', realtyConsultant: '' })
394
+ }
395
+
396
+ // 返回到首页
397
+ function returList(params) {
398
+  router.push({
399
+      pathname: '/activity/helpActivity/list',
400
+    });
401
+}
402
+
403
+  const publicColumns = [
404
+    {
405
+      title: '发起者',
406
+      dataIndex: 'name',
407
+      key: 'name',
408
+      align: 'center',
409
+      width: '15%',
410
+    },
411
+    {
412
+      title: '发起者手机号',
413
+      dataIndex: 'phone',
414
+      key: 'phone',
415
+      align: 'center',
416
+      width: '10%',
417
+    },
418
+    {
419
+      title: '发起时间',
420
+      dataIndex: 'createDate',
421
+      key: 'createDate',
422
+      align: 'center',
423
+      width: '15%',
424
+      render: (x, row) => <><span>{`${moment(row.createDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
425
+    },
426
+    {
427
+      title: '助力者',
428
+      dataIndex: 'helpCount',
429
+      key: 'helpCount',
430
+      align: 'center',
431
+      width: '15%',
432
+      render: (text, record) => <a style={ { color: '#66B3FF' } } onClick={() => helpRecord(record)}>{record.helpCount}/{record.persionNumCount}</a>,
433
+    },
434
+  ]
435
+
436
+  const privateColumns = [
437
+    {
438
+      title: '发起者',
439
+      dataIndex: 'name',
440
+      key: 'name',
441
+      align: 'center',
442
+      width: '15%',
443
+      // render: (_, record) => <Avatar shape="square" src={customerType === 'helpSucceed' ? record.picture : record.avatarurl} size={64} icon="user" />,
444
+    },
445
+    {
446
+      title: '手机号',
447
+      dataIndex: 'phone',
448
+      key: 'phone',
449
+      align: 'center',
450
+      width: '10%',
451
+      // eslint-disable-next-line no-nested-ternary
452
+      // render: (_, record) => <><span>{customerType === 'helpSucceed' ? record.name : record.nickname}</span></>,
453
+    },
454
+    {
455
+      title: '发起时间',
456
+      dataIndex: 'createDate',
457
+      key: 'createDate',
458
+      align: 'center',
459
+      width: '10%',
460
+      render: (x, row) => <><span>{`${moment(row.createDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
461
+      // eslint-disable-next-line no-nested-ternary
462
+    },
463
+    {
464
+      title: '助力者',
465
+      dataIndex: 'helpCount',
466
+      key: 'helpCount',
467
+      align: 'center',
468
+      width: '15%',
469
+      render: (text, record) => <a style={ { color: '#66B3FF' } } onClick={() => helpRecord(record)}>{record.helpCount}人</a>,
470
+    },
471
+    {
472
+      title: '核销状态',
473
+      dataIndex: 'reportRecommendStatus',
474
+      key: 'reportRecommendStatus',
475
+      align: 'center',
476
+      width: '10%',
477
+      // eslint-disable-next-line no-nested-ternary
478
+      render: (text, records) => {
479
+        if (records.verificationStatus === 0 || records.verificationStatus === null) { return '未核销' }
480
+        if (records.verificationStatus === 1) { return '已核销' }
481
+      },
482
+    },
483
+    {
484
+      title: '操作',
485
+      align: 'center',
486
+      width: '25%',
487
+      render: (x, row) => (
488
+        <>
489
+          {row.verificationStatus === 0 &&
490
+          <AuthButton name="admin.SignList.get" noRight={null}>
491
+           <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={() => helpInitiateRecordVerify(row)}>核销</span>
492
+          </AuthButton>
493
+        }
494
+        </>
495
+      ),
496
+    },
497
+  ]
498
+
499
+  return (
500
+    <>
501
+    {console.log('customerType', customerType)}
502
+      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
503
+        <Form.Item>
504
+          {getFieldDecorator('tel')(
505
+            <Input
506
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
507
+              placeholder="电话"
508
+            />,
509
+          )}
510
+        </Form.Item>
511
+        <Form.Item>
512
+            <Button type="primary" htmlType="submit" >
513
+              查询
514
+            </Button>
515
+            <Button style={{ marginLeft: 8 }} onClick={handleReset}>
516
+              重置
517
+            </Button>
518
+            <Button style={{ marginLeft: 8 }} onClick={returList}>
519
+              返回
520
+            </Button>
521
+        </Form.Item>
522
+      </Form>
523
+      <Button name="admin.helpRecord.export.get" noRight={null} type="primary" onClick={() => exportCustomer()} style={{ float: 'right', margin: '20px 0', zIndex: 1 }}>
524
+        导出
525
+      </Button>
526
+
527
+      <div style={{ margin: '20px 0' }}>
528
+          <Radio.Group value={customerType} onChange={radioButtonHandleSizeChange} buttonStyle="solid">
529
+            <Radio.Button value="helpSucceed">助力成功</Radio.Button>
530
+            <Radio.Button value="helpUnderway">进行中</Radio.Button>
531
+            <Radio.Button value="helpUnfinished">助力失败</Radio.Button>
532
+          </Radio.Group>
533
+      </div>
534
+      {customerType === 'helpSucceed' ?
535
+        <Table dataSource={dataSource.list} columns={privateColumns} pagination={{ total: dataSource.total, onChange }} rowKey="customerList" /> :
536
+        <Table dataSource={dataSource.list} columns={publicColumns} pagination={{ total: dataSource.total, onChange }} rowKey="customerList" />
537
+      }
538
+        <Verifier visibleData={gVerifierData} onSuccess={e => onSuccess(e)} onCancel={(e) => onCancel(e)} />
539
+       <InviteTable visibleData={gInviteData} onSuccess={e => onSuccess(e)} onCancel={(e) => onCancel(e)}/>
540
+    </>
541
+  );
542
+}
543
+
544
+const WrappedBody = Form.create({ name: 'body' })(body);
545
+
546
+export default WrappedBody

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

@@ -184,6 +184,7 @@ function AddBuilding(props) {
184 184
       data.buildingTransport = tagFilter(data.buildingTransport, 'Transport')
185 185
     }
186 186
     if (data.buildingMall) {
187
+      debugger
187 188
       data.buildingMall = tagFilter(data.buildingMall, 'Mall')
188 189
     }
189 190
     if (data.buildingEdu) {
@@ -199,6 +200,7 @@ function AddBuilding(props) {
199 200
       data.buildingRestaurant = tagFilter(data.buildingRestaurant, 'Restaurant')
200 201
     }
201 202
 
203
+    debugger
202 204
     const api = data.buildingId === undefined ? apis.building.addBuilding : apis.building.updateBuilding
203 205
     request({ ...api, data: { ...data } }).then(res => {
204 206
       openNotificationWithIcon('success', '操作成功')
@@ -226,7 +228,9 @@ function AddBuilding(props) {
226 228
     const determineTag = poi.map(p => {
227 229
       if (p.key === keyType) {
228 230
         if (typeof p.data === 'string') {
229
-          p.data = JSON.parse(p.data).filter(f => automaticTag.includes(f.name))
231
+          p.data = JSON.parse(p.data).filter(f => automaticTag.includes(f.name)) || []
232
+        } else {
233
+          p.data = p.data.filter(x => tags.some(t => !t.automatic || t.tagName === x.name))
230 234
         }
231 235
       }
232 236
       return p
@@ -441,7 +445,7 @@ function AddBuilding(props) {
441 445
               <ImageUpload />,
442 446
             )}
443 447
           </Form.Item> */}
444
-          <Form.Item label="排序" >
448
+          <Form.Item label="排序" help="数值越大,楼盘在列表页中展示越靠前">
445 449
             {getFieldDecorator('orderNo')(<Input />)}
446 450
           </Form.Item>
447 451
           {/* <Form.Item label="优惠信息" >

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

@@ -4,6 +4,7 @@ import ImageListUpload from '../../../../../components/XForm/ImageListUpload';
4 4
 import moment from 'moment';
5 5
 import request from '../../../../../utils/request';
6 6
 import apis from '../../../../../services/apis';
7
+import router from 'umi/router';
7 8
 
8 9
 const { Header, Footer, Sider, Content } = Layout;
9 10
 
@@ -221,6 +222,7 @@ function BuildingImageModel(props) {
221 222
 
222 223
   return (
223 224
     <>
225
+      <Button type="danger" style={{ marginLeft: '18px', float: 'right' }} onClick={() => router.go(-1)}>返回</Button>
224 226
       <span style={{ marginTop: '10px', marginBottom: '10px' }}>{props.apartment.apartmentName}({imageList.length})</span>
225 227
       <Button type="link" style={{ color: 'blue' }} onClick={() => edi()}>重命名</Button>
226 228
       <Button type="link" style={{ color: 'blue' }} onClick={() => deletePhoto()}>删除相册</Button>

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

@@ -40,7 +40,7 @@ class TypeForm extends React.Component {
40 40
         }
41 41
         
42 42
         values.buildingTypeName = this.props.type.buildingTypeName
43
-        console.log('values: ', values)
43
+        console.log('valuesvaluesvaluesvalues: ', values)
44 44
         this.props.onSuccess(values)
45 45
       }
46 46
     });
@@ -144,13 +144,17 @@ class ProjectTypeBody extends React.Component {
144 144
   }
145 145
 
146 146
   onClose = e => {
147
+    console.log(2)
147 148
     const { data } = this.state
148 149
     console.log('onClose——data: ', data)
149 150
     console.log('onClose: ', e.buildingTypeId)
150 151
     const buildingType = data.filter(item => e.buildingTypeId !== item.buildingTypeId)
151
-    console.log('onClose——data: ', buildingType)
152
+    console.log('onClose——data111: ', buildingType)
152 153
     this.setState({ data: buildingType })
153 154
     this.setState({ defaultCheckboxValue: buildingType.map(item => item.buildingTypeId) })
155
+    if (typeof this.props.onChange === 'function') {
156
+      this.props.onChange(buildingType)
157
+    }
154 158
   }
155 159
 
156 160
   getNewProjectType = values => {
@@ -237,8 +241,14 @@ class ProjectTypeBody extends React.Component {
237 241
         <Modal
238 242
           title="项目类型"
239 243
           visible={this.state.visible}
240
-          onOk={this.handleOk}
244
+          // onOk={this.handleOk}
241 245
           onCancel={this.handleCancel}
246
+          footer={
247
+            [
248
+            <Button key="submit" type="primary" onClick={this.handleOk}>
249
+             确定  
250
+            </Button>] 
251
+          }
242 252
         >
243 253
           <Checkbox.Group options={this.state.projectType.map(item => ({ label: item.buildingTypeName, value: item.buildingTypeId }))} onChange={e => this.onCheckboxChange(e)} value={this.state.defaultCheckboxValue}/>
244 254
         </Modal>

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

@@ -119,13 +119,13 @@ function imageSet(props) {
119 119
       title: '面积',
120 120
       dataIndex: 'buildingArea',
121 121
       key: 'buildingArea',
122
-      render: (buildingArea, _) => <span>{ `${buildingArea}m²` }</span>,
122
+      render: (buildingArea, _) => <span>{ `${buildingArea === 0 || buildingArea === null ? "-" : buildingArea + "m²"}` }</span>,
123 123
     },
124 124
     {
125 125
       title: '套内面积',
126 126
       dataIndex: 'insideArea',
127 127
       key: 'insideArea',
128
-      render: (insideArea, _) => <span>{ `${insideArea === 0 ? "-" : insideArea + "m²"}` }</span>,
128
+      render: (insideArea, _) => <span>{ `${insideArea === 0 || insideArea === null ? "-" : insideArea + "m²"}` }</span>,
129 129
     },
130 130
     {
131 131
       title: '创建时间',
@@ -149,6 +149,7 @@ function imageSet(props) {
149 149
   return (
150 150
     <>
151 151
       <Button type="primary" onClick={() => showEdi()}>新增户型</Button>
152
+      <Button type="danger" style={{ marginLeft: '18px'}} onClick={() => router.go(-1)}>返回</Button>
152 153
       <Table dataSource={data} columns={columns} pagination={false} rowKey="imageSet" />
153 154
 
154 155
       {/* 编辑页 */}

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

@@ -196,9 +196,9 @@ class ModalImage extends React.Component {
196 196
               </Form.Item>
197 197
               <Form.Item label="面积" help="单位 ㎡">
198 198
                 {getFieldDecorator('buildingArea', {
199
-                  rules: [{ required: true, message: '请填写面积' },
199
+                  rules: [{ message: '请填写面积' },
200 200
                           {
201
-                            pattern: new RegExp('^[0-9]*$'),
201
+                            pattern: new RegExp('^[1-9][0-9]*(\.[0-9]{1,2})?$'),
202 202
                             message: '只允许输入数字',
203 203
                           },
204 204
                   ],
@@ -209,7 +209,7 @@ class ModalImage extends React.Component {
209 209
                   rules: [
210 210
                     // { required: true, message: '请填写套内面积' },
211 211
                           {
212
-                            pattern: new RegExp('^[0-9]*$'),
212
+                            pattern: new RegExp('^[1-9][0-9]*(\.[0-9]{1,2})?$'),
213 213
                             message: '只允许输入数字',
214 214
                           },
215 215
                   ],

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

@@ -106,7 +106,7 @@ const Poster = props => {
106 106
     <div style={{ display: 'flex' }}>
107 107
       <div style={{ width: '420px', height: '900px', display: 'inline-block', marginTop: '30px' }}>
108 108
         <div style={{ width: '375px', height: '700px', backgroundColor: '#fff', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
109
-          <img style={{ width: '100%', height: '300px' }} src={imgValue || (building.buildingImg[0].url || poster1)} alt="" />
109
+          <img style={{ width: '100%', height: '300px' }} src={imgValue ? imgValue : poster1} alt="" />
110 110
 
111 111
           <p className={Styles.tagLabel}>
112 112
             {
@@ -151,7 +151,7 @@ const Poster = props => {
151 151
         </div>
152 152
         <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
153 153
           <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报描述</p>
154
-          <TextArea rows={5} value={textAreaValue} onChange={e => changeTextArea(e.target.value)} />
154
+          <TextArea rows={5} maxLength={1024} value={textAreaValue} onChange={e => changeTextArea(e.target.value)} />
155 155
         </div>
156 156
 
157 157
       </div>

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

@@ -76,7 +76,7 @@ const Share = props => {
76 76
           知与行互动
77 77
         </p>
78 78
         <p style={{ fontSize: '16px', color: '#222', fontWeight: '600', margin: '0' }}>{inputValue ? inputValue : '置业V客厅 精准获客平台'}</p>
79
-        <img style={{ width: '200px', height: '140px' }} src={imgValue ? imgValue : poster2} alt="" />
79
+        <img style={{ width: '200px', height: '160px' }} src={imgValue ? imgValue : poster2} alt="" />
80 80
       </div>
81 81
     </div>
82 82
     <div style={{ display: 'flex', alignItems: 'center', width: '100%' }}>

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

@@ -96,68 +96,69 @@ function CartBody(props) {
96 96
       },
97 97
     });
98 98
   }
99
-// src={((data.buildingImg && data.buildingImg[0]) || {}).url}background: `url(${item.caseCoverImg})` style={{ background: `url(((data.buildingImg && data.buildingImg[0]) || {}).url)` }}
99
+  // src={((data.buildingImg && data.buildingImg[0]) || {}).url}background: `url(${item.caseCoverImg})` style={{ background: `url(((data.buildingImg && data.buildingImg[0]) || {}).url)` }}
100 100
   const { buildingImg } = data
101 101
   console.log("buildingImg1: ", data.buildingImg)
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={}
107
-      // bodyStyle={{ padding: '10px 20px' }}
106
+    // cover={}
107
+    // bodyStyle={{ padding: '10px 20px' }}
108 108
     >
109 109
       {/* 因为 background 方式设置图片背景,如果 图片url 存在空格或者其他特殊字符,导致显示不出来,需要进行 encodeURI(xxx) 转码 */}
110
-    <img className={Styles.cover} style={{ backgroundImage: `url('${encodeURI( ((data.buildingListImg && data.buildingListImg[0]) || {}).url )}')` }}   ></img>
111
-    <div style={{ padding: '10px 20px' }}>
112
-      <p className={Styles.cardText}>
113
-        <span className={Styles.title}>楼盘编号</span>
114
-        <span style={{textOverflow: 'ellipsis',  whiteSpace: 'nowrap',  overflow: 'hidden'}}>:{data.code}</span>
115
-        <AuthButton name="admin.building.update.put" noRight={null}>
116
-          <span className={Styles.ediText} onClick={() => toEdi(data)}>
117
-            编辑
110
+        <span className={Styles.recommderTag}>{data.isMain === 1 ? '首页推荐':''}</span>
111
+        <img className={Styles.cover} style={{ backgroundImage: `url('${encodeURI(((data.buildingListImg && data.buildingListImg[0]) || {}).url)}')` }}   ></img>
112
+      <div style={{ padding: '10px 20px' }}>
113
+        <p className={Styles.cardText}>
114
+          <span className={Styles.title}>楼盘编号</span>
115
+          <span style={{ textOverflow: 'ellipsis', whiteSpace: 'nowrap', overflow: 'hidden' }}>:{data.code}</span>
116
+          <AuthButton name="admin.building.update" noRight={null}>
117
+            <span className={Styles.ediText} onClick={() => toEdi(data)}>
118
+              编辑
118 119
                   <Icon type="form" style={{ color: '#C0C4CC', marginLeft: '10px' }} />
119
-          </span>
120
-        </AuthButton>
121
-      </p>
122
-      <p className={Styles.cardText}>
123
-        <span className={Styles.title}>楼盘名称</span>
124
-        <span style={{textOverflow: 'ellipsis',  whiteSpace: 'nowrap',  overflow: 'hidden'}}>:{data.buildingName || data.name}</span>
125
-      </p>
126
-      <p className={Styles.cardItem}>
127
-        <span className={Styles.title}>均价</span>
128
-        <span >
129
-          :约<span style={{ color: '#FF0707', fontSize: '20px' }}> {data.price || '待定'} </span>元/m²
120
+            </span>
121
+          </AuthButton>
122
+        </p>
123
+        <p className={Styles.cardText}>
124
+          <span className={Styles.title}>楼盘名称</span>
125
+          <span style={{ textOverflow: 'ellipsis', whiteSpace: 'nowrap', overflow: 'hidden' }}>:{data.buildingName || data.name}</span>
126
+        </p>
127
+        <p className={Styles.cardItem}>
128
+          <span className={Styles.title}>均价</span>
129
+          <span >
130
+            :约<span style={{ color: '#FF0707', fontSize: '20px' }}> {data.price || '待定'} </span>元/m²
130 131
         </span>
131
-      </p>
132
-      <p className={Styles.cardItem}>
133
-        <span className={Styles.title}>项目地址</span>
134
-        <span className={Styles.address}>:{data.address}</span>
135
-      </p>
136
-      <p className={Styles.cardItem}>
137
-        <span className={Styles.title}>发布状态</span>
138
-        <span >:{data.status === 1 ? '已发布' : '未发布'}</span>
139
-      </p>
140
-      <p className={Styles.cardItem}>
141
-        <span className={Styles.title}>录入时间</span>
142
-        <span >:{moment(data.createDate).format('YYYY-MM-DD HH:mm:ss')}</span>
143
-      </p>
144
-      <p style={{ margin: '15px 0', position: 'relative', fontSize: '0.106rem' }}>
145
-      <AuthButton name="admin.building.update.status.put" noRight={null}>
146
-        <span style={{ color: '#FF4A4A' }} onClick={() => pulicAndUnPulic(data)}>
147
-          {/* 已发布的时候,需要显示取消发布的字样 */}
148
-          {data.status === 1 ? '取消发布' : '发布'}
149
-          <Icon type={data.status === 1 ? 'close-circle' : 'form'} style={{ color: '#C0C4CC', marginLeft: '8px' }} />
150
-        </span>
151
-      </AuthButton>
152
-      <AuthButton name="admin.building.delete.id.delete" noRight={null}>
153
-        <span style={{
154
-          color: '#FF4A4A', position: 'absolute', right: '0',
155
-        }} onClick={() => deleteBuilding(data)}>
156
-          删除
132
+        </p>
133
+        <p className={Styles.cardItem}>
134
+          <span className={Styles.title}>项目地址</span>
135
+          <span className={Styles.address}>:{data.address}</span>
136
+        </p>
137
+        <p className={Styles.cardItem}>
138
+          <span className={Styles.title}>发布状态</span>
139
+          <span >:{data.status === 1 ? '已发布' : '未发布'}</span>
140
+        </p>
141
+        <p className={Styles.cardItem}>
142
+          <span className={Styles.title}>录入时间</span>
143
+          <span >:{moment(data.createDate).format('YYYY-MM-DD HH:mm:ss')}</span>
144
+        </p>
145
+        <p style={{ margin: '20px 0', position: 'relative', fontSize: '0.106rem' }}>
146
+          <AuthButton name="admin.building.public" noRight={null}>
147
+            <span style={{ color: '#FF4A4A' }} onClick={() => pulicAndUnPulic(data)}>
148
+              {/* 已发布的时候,需要显示取消发布的字样 */}
149
+              {data.status === 1 ? '取消发布' : '发布'}
150
+              <Icon type={data.status === 1 ? 'close-circle' : 'form'} style={{ color: '#C0C4CC', marginLeft: '8px' }} />
151
+            </span>
152
+          </AuthButton>
153
+          <AuthButton name="admin.building.delete" noRight={null}>
154
+            <span style={{
155
+              color: '#FF4A4A', position: 'absolute', right: '0',bottom:'0'
156
+            }} onClick={() => deleteBuilding(data)}>
157
+              删除
157 158
                 <Icon type="rest" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
158
-        </span>
159
-      </AuthButton>
160
-      </p>
159
+            </span>
160
+          </AuthButton>
161
+        </p>
161 162
       </div>
162 163
     </Card>
163 164
   )
@@ -184,7 +185,7 @@ function body(props) {
184 185
     // 网路请求
185 186
     request({ ...apis.building.getList, params: { ...params } }).then(res => {
186 187
       setDataSource(res)
187
-      console.log("res:",res)
188
+      console.log("res:", res)
188 189
     }).catch(err => {
189 190
       // eslint-disable-next-line no-unused-expressions
190 191
       <Alert
@@ -207,7 +208,7 @@ function body(props) {
207 208
         console.log('提交数据: ', values)
208 209
         const { startDate } = values
209 210
         if (values.startDate !== undefined) {
210
-         
211
+
211 212
           values.startDate = `${moment(startDate).format('YYYY-MM-DDT00:00:00.000')}Z`
212 213
         }
213 214
         getList({ pageNum: 1, pageSize: 9, ...values })
@@ -235,7 +236,7 @@ function body(props) {
235 236
 
236 237
   function toAdd() {
237 238
     // 判断楼盘是否最可以添加
238
-    request({ ...apis.building.verifyMax}).then(res => {
239
+    request({ ...apis.building.verifyMax }).then(res => {
239 240
       router.push({ pathname: '/building/list/add' })
240 241
     }).catch(err => {
241 242
       // eslint-disable-next-line no-unused-expressions
@@ -299,15 +300,15 @@ function body(props) {
299 300
         <Form.Item>
300 301
           {getFieldDecorator('marketStatus')(
301 302
             <Select style={{ width: '180px' }} placeholder="销售状态" onChange={handleSelectChange}>
302
-                <Option value="待定">待定</Option>
303
-                <Option value="在售">在售</Option>
304
-                <Option value="售完">售完</Option>
303
+              <Option value="待定">待定</Option>
304
+              <Option value="在售">在售</Option>
305
+              <Option value="售完">售完</Option>
305 306
             </Select>,
306 307
           )}
307 308
         </Form.Item>
308 309
         <Form.Item>
309 310
           {getFieldDecorator('cityId')(
310
-             <SelectCity />,
311
+            <SelectCity />,
311 312
           )}
312 313
         </Form.Item>
313 314
         <Form.Item>
@@ -319,16 +320,16 @@ function body(props) {
319 320
           )}
320 321
         </Form.Item>
321 322
         <Form.Item>
322
-            <Button type="primary" htmlType="submit">
323
-              搜索
323
+          <Button type="primary" htmlType="submit">
324
+            搜索
324 325
             </Button>
325
-            <Button style={{ marginLeft: 8 }} onClick={handleReset}>
326
-              重置
326
+          <Button style={{ marginLeft: 8 }} onClick={handleReset}>
327
+            重置
327 328
             </Button>
328 329
         </Form.Item>
329 330
       </Form>
330 331
 
331
-      <AuthButton name="admin.building.add.post" noRight={null}>
332
+      <AuthButton name="admin.building.add" noRight={null}>
332 333
         <Button type="danger" className={Styles.addButton} onClick={() => toAdd()}>
333 334
           新增楼盘
334 335
         </Button>

+ 12
- 2
src/pages/building/list/style.less Прегледај датотеку

@@ -20,8 +20,18 @@
20 20
   display: flex;
21 21
   align-items: center;
22 22
   position: relative;
23
-  margin-bottom: 0.08rem;
24
-  
23
+  margin-bottom: 0.08rem; 
24
+}
25
+
26
+.recommderTag{
27
+  position: absolute;
28
+  color: #fff;
29
+  line-height: 0.28rem;
30
+  width: 0.54rem;
31
+  background-color: rgba(0,0,0,0.4);
32
+  text-align: center;
33
+  border-radius: 12px 0 12px 0;
34
+  font-size: 0.09rem;
25 35
 }
26 36
 .cardItem{
27 37
   font-size: 0.106rem;

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

@@ -37,18 +37,22 @@ function body() {
37 37
       key: 'row',
38 38
       render: (_, record) => (
39 39
         <span >
40
-          <Button type="link" style={{
41
-            color: '#FF4A4A', right: '0',
42
-          }} onClick={() => deleteType(record)}>
43
-            删除
44
-            <Icon type="rest" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
45
-          </Button>
46
-          <Button type="link" style={{
47
-            color: '#FF4A4A', right: '0',
48
-          }} onClick={() => toEdi(record.buildingTypeId)}>
49
-            编辑
50
-            <Icon type="copy" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
51
-          </Button>
40
+          <AuthButton name="admin.tdBuildingType.delete" noRight={null}>
41
+            <Button type="link" style={{
42
+              color: '#FF4A4A', right: '0',
43
+            }} onClick={() => deleteType(record)}>
44
+              删除
45
+              <Icon type="rest" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
46
+            </Button>
47
+          </AuthButton>
48
+          <AuthButton name="admin.tdBuildingType.update" noRight={null}>
49
+            <Button type="link" style={{
50
+              color: '#FF4A4A', right: '0',
51
+            }} onClick={() => toEdi(record.buildingTypeId)}>
52
+              编辑
53
+              <Icon type="copy" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
54
+            </Button>
55
+          </AuthButton>
52 56
         </span>
53 57
       ),
54 58
     },
@@ -119,7 +123,7 @@ function body() {
119 123
 
120 124
   return (
121 125
     <>
122
-      <AuthButton name="admin.tdBuildingType.post" noRight={null}>
126
+      <AuthButton name="admin.tdBuildingType.add" noRight={null}>
123 127
         <Button type="danger" onClick={() => toEdi()}>新增类型</Button>
124 128
       </AuthButton>
125 129
       <Table style={{ marginTop: '30px' }} dataSource={data.records} columns={columns} pagination={false} rowKey="buildingType"/>

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

@@ -1,8 +1,9 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import{ Select, Modal } from 'antd';
2
+import { Form, Select, Modal, Button, Table, Divider, Tag, Input } from 'antd';
3 3
 import { apis, fetch } from '../../utils/request';
4 4
 
5
-const getActivities = fetch(apis.activity.list)
5
+const getActivities = fetch(apis.activity.listSelected)
6
+const { Search } = Input;
6 7
 
7 8
 export default (props) => {
8 9
   const {
@@ -13,18 +14,19 @@ export default (props) => {
13 14
 
14 15
   const [list, setList] = useState([]);
15 16
   const [visible, setVisible] = useState(false);
16
-  const [ activity, setActivity ] = useState({ dynamicId: undefined, title: '请选择活动' })
17
+  const [activity, setActivity] = useState({ dynamicId: undefined, title: '请选择活动' })
17 18
   const getActTitle = val => ((list.filter(x => x.dynamicId === val)[0]) || {}).title || '请选择活动'
18 19
   const setAct = val => setActivity({ dynamicId: val, title: getActTitle(val) })
19 20
 
20 21
   const buildingId = props.buildingId()
21
-  
22
+
22 23
   useEffect(() => {
23 24
     getActivities({
24 25
       params: {
25 26
         buildingId,
26 27
         pageNum: 1,
27 28
         pageSize: 999,
29
+        activityStatus: 2,
28 30
       }
29 31
     }).then((data) => {
30 32
       setList(data.list || [])
@@ -38,37 +40,76 @@ export default (props) => {
38 40
   if (value !== activity.dynamicId) {
39 41
     setAct(value);
40 42
   }
43
+  const searchActivity =(e)=>{
44
+    getActivities({
45
+      params: {
46
+        buildingId,
47
+        pageNum: 1,
48
+        pageSize: 999,
49
+        activityStatus: 2,
50
+        name:e
51
+      }
52
+    }).then((data) => {
53
+      setList(data.list || [])
54
+
55
+      console.log('----', buildingId, value)
56
+
57
+      // setAct(buildingId ? undefined : value);
58
+    })
59
+  }
41 60
 
42 61
   let chooseVal = value
43 62
 
44 63
   const handleChange = val => chooseVal = val
45 64
 
65
+  const setData = val => {
66
+    setAct(val)
67
+    onChange(val)
68
+    setVisible(false)
69
+  }
70
+
71
+  const columns = [
72
+    {
73
+      title: '标题',
74
+      dataIndex: 'title',
75
+      key: 'dynamicId',
76
+      align: 'center',
77
+      ellipsis: true,
78
+      render: text => <a>{text}</a>,
79
+    },
80
+    {
81
+      title: '操作',
82
+      dataIndex: 'name',
83
+      align: 'center',
84
+      width: '20%',
85
+      render: (text, record) => (
86
+        <span>
87
+          <a onClick={() => setData(record.dynamicId)} style={{ color: 'blue' }}>选择</a>
88
+        </span>
89
+      ),
90
+    },
91
+  ];
92
+
46 93
   return (
94
+
47 95
     <div>
48 96
       <div onClick={() => setVisible(true)}>{activity.title}</div>
49 97
       <Modal
50
-        title="请选择活动"
98
+        title="请选择"
51 99
         visible={visible}
52
-        onOk={() => {
53
-          setAct(chooseVal)
54
-          onChange(chooseVal)
55
-          setVisible(false)
56
-        }}
57 100
         onCancel={() => setVisible(false)}
101
+        footer={[]}
58 102
       >
59
-        <Select
60
-        showSearch
61
-        filterOption={(input, option) =>
62
-          option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
63
-        }
64
-        defaultValue={chooseVal} 
65
-        onChange={handleChange} 
66
-        style={{ width: '90%' }}>
67
-          {
68
-            list.map(x => (<Select.Option key={x.dynamicId} value={x.dynamicId}>{x.title}</Select.Option>))
69
-          }
70
-        </Select>
103
+        <Search
104
+          placeholder="请输入标题"
105
+          enterButton="搜索"
106
+          size="large"
107
+          onSearch={value => searchActivity(value)}
108
+          style={{ marginBottom: '16px' }}
109
+        />
110
+        <Table rowKey={list => list.dynamicId} columns={columns} dataSource={list} />
71 111
       </Modal>
72 112
     </div>
113
+
73 114
   );
74 115
 }

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

@@ -1,7 +1,9 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Select, Modal } from 'antd';
2
+import { Form, Select, Modal, Button, Table, Divider, Tag, Input } from 'antd';
3 3
 import { apis, fetch } from '../../utils/request';
4 4
 
5
+const { Search } = Input;
6
+
5 7
 const getGroupList = fetch(apis.groupActivity.EffectiveList)
6 8
 
7 9
 export default props => {
@@ -27,6 +29,7 @@ export default props => {
27 29
         buildingId,
28 30
         pageNum: 1,
29 31
         pageSize: 999,
32
+        status: 1,
30 33
       },
31 34
     }).then(data => {
32 35
       setList(data.records || [])
@@ -34,40 +37,74 @@ export default props => {
34 37
       updateGroup(buildingId ? undefined : value);
35 38
     })
36 39
   }, [buildingId]);
40
+  const searchGroup = (e) => {
41
+    getGroupList({
42
+      params: {
43
+        buildingId,
44
+        pageNum: 1,
45
+        pageSize: 999,
46
+        status: 1,
47
+        name: e
48
+      }
49
+    }).then((data) => {
50
+      setList(data.records || [])
37 51
 
52
+      updateGroup(buildingId ? undefined : value);
53
+      // setAct(buildingId ? undefined : value);
54
+    })
55
+  }
38 56
   if (value !== group.groupId) {
39 57
     updateGroup(value);
40 58
   }
41 59
 
42 60
   const handleChange = val => {
43
-      onChange(val)
61
+    onChange(val)
44 62
   }
45 63
 
64
+  const setData = val => {
65
+    updateGroup(val)
66
+    onChange(val)
67
+    setVisible(false)
68
+  }
69
+
70
+  const columns = [
71
+    {
72
+      title: '标题',
73
+      dataIndex: 'activityName',
74
+      key: 'groupActivityId',
75
+      align: 'center',
76
+      ellipsis: true,
77
+      render: text => <a>{text}</a>,
78
+    },
79
+    {
80
+      title: '操作',
81
+      align: 'center',
82
+      width: '20%',
83
+      render: (text, record) => (
84
+        <span>
85
+          <a onClick={() => setData(record.groupActivityId)} style={{ color: 'blue' }}>选择</a>
86
+        </span>
87
+      ),
88
+    },
89
+  ];
90
+
46 91
   return (
47 92
     <div>
48 93
       <div onClick={() => setVisible(true)}>{group.groupName}</div>
49 94
       <Modal
50
-        title="请选择拼团"
95
+        title="请选择"
51 96
         visible={visible}
52
-        onOk={() => {
53
-          updateGroup(value)
54
-          onChange(value)
55
-          setVisible(false)
56
-        }}
57 97
         onCancel={() => setVisible(false)}
98
+        footer={[]}
58 99
       >
59
-        <Select
60
-          showSearch
61
-          value={value ? parseInt(value) : undefined}
62
-          onChange={handleChange}
63
-          style={{ width: '90%' }}
64
-          filterOption={(input, option) =>
65
-            option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
66
-          }>
67
-          {
68
-            list.map(x => (<Select.Option key={x.groupActivityId} value={x.groupActivityId}>{x.activityName}</Select.Option>))
69
-          }
70
-        </Select>
100
+        <Search
101
+          placeholder="请输入标题"
102
+          enterButton="搜索"
103
+          size="large"
104
+          onSearch={value => searchGroup(value)}
105
+          style={{ marginBottom: '16px' }}
106
+        />
107
+        <Table rowKey={list => list.groupActivityId} columns={columns} dataSource={list} />
71 108
       </Modal>
72 109
     </div>
73 110
   );

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

@@ -0,0 +1,111 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Select, Modal, Button, Input } from 'antd';
3
+import { apis, fetch } from '../../utils/request';
4
+
5
+const getH5List = fetch(apis.h5Activity.EffectiveList)
6
+const { Search } = Input;
7
+
8
+export default props => {
9
+  const {
10
+    value,
11
+    onChange,
12
+    ...rest
13
+  } = props;
14
+
15
+  const [list, setList] = useState([]);
16
+  const [visible, setVisible] = useState(false);
17
+  const [group, setGroup] = useState({ groupId: undefined, groupName: '请选择' })
18
+  const getGroupTitle = val => {
19
+    return (list.filter(x => x.drainageId == val)[0] || {}).name || '请选择'
20
+  }
21
+  const updateGroup = val => setGroup({ groupId: val, groupName: getGroupTitle(val) })
22
+
23
+  useEffect(() => {
24
+    getH5List({
25
+      params: {
26
+        pageNum: 1,
27
+        pageSize: 999,
28
+        isMiniapp: 1,
29
+        status: 1,
30
+      },
31
+    }).then(data => {
32
+      setList(data.records || [])
33
+
34
+      updateGroup(value ? undefined : value);
35
+    })
36
+  }, []);
37
+  const searchH5 = (e) => {
38
+    getH5List({
39
+      params: {
40
+        buildingId,
41
+        pageNum: 1,
42
+        pageSize: 999,
43
+        activityStatus: 2,
44
+        name: e
45
+      }
46
+    }).then((data) => {
47
+      setList(data.records || [])
48
+
49
+      updateGroup(value ? undefined : value);
50
+    })
51
+  }
52
+
53
+  if (value !== group.groupId) {
54
+    updateGroup(value);
55
+  }
56
+
57
+  const handleChange = val => {
58
+    onChange(val)
59
+  }
60
+
61
+  const setData = val => {
62
+    updateGroup('')
63
+    onChange('')
64
+  }
65
+
66
+  return (
67
+    <div>
68
+      <div onClick={() => setVisible(true)}>{group.groupName}</div>
69
+      <Modal
70
+        title="请选择"
71
+        visible={visible}
72
+        onCancel={() => setVisible(false)}
73
+        footer={[
74
+          <Button key="back" onClick={() => setVisible(false)}>
75
+            取消
76
+            </Button>,
77
+          <Button key="cancel" onClick={() => setData(value)}>
78
+            清空
79
+            </Button>,
80
+          <Button key="submit" type="primary" onClick={() => {
81
+            updateGroup(value)
82
+            onChange(value)
83
+            setVisible(false)
84
+          }}>
85
+            提交
86
+            </Button>
87
+        ]}
88
+      >
89
+        <Search
90
+          placeholder="请输入标题"
91
+          enterButton="搜索"
92
+          size="large"
93
+          onSearch={value => searchH5(value)}
94
+          style={{ marginBottom: '16px' }}
95
+        />
96
+        <Select
97
+          showSearch
98
+          value={value ? parseInt(value) : undefined}
99
+          onChange={handleChange}
100
+          style={{ width: '90%' }}
101
+          filterOption={(input, option) =>
102
+            option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
103
+          }>
104
+          {
105
+            list.map(x => (<Select.Option key={x.drainageId} value={x.drainageId}>{x.name}</Select.Option>))
106
+          }
107
+        </Select>
108
+      </Modal>
109
+    </div>
110
+  );
111
+}

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

@@ -0,0 +1,123 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Select, Modal, Button, Table, Divider, Tag, Input,Row,Col } from 'antd';
3
+import { apis, fetch } from '../../utils/request';
4
+
5
+const { Column, ColumnGroup } = Table;
6
+const getH5List = fetch(apis.h5Activity.EffectiveList)
7
+const { Search } = Input;
8
+export default props => {
9
+  const {
10
+    value,
11
+    onChange,
12
+    ...rest
13
+  } = props;
14
+
15
+  const [list, setList] = useState([]);
16
+  const [visible, setVisible] = useState(false);
17
+  const [group, setGroup] = useState({ groupId: undefined, groupName: '请选择' })
18
+  const getGroupTitle = val => {
19
+    return (list.filter(x => x.drainageId == val)[0] || {}).name || '请选择'
20
+  }
21
+  const updateGroup = val => setGroup({ groupId: val, groupName: getGroupTitle(val) })
22
+
23
+  useEffect(() => {
24
+    getH5List({
25
+      params: {
26
+        pageNum: 1,
27
+        pageSize: 999,
28
+        isMiniapp: 1,
29
+        status: 1,
30
+      },
31
+    }).then(data => {
32
+      setList(data.records || [])
33
+
34
+      updateGroup(value ? undefined : value);
35
+    })
36
+  }, []);
37
+  const searchH5 = (e) => {
38
+    getH5List({
39
+      params: {
40
+        pageNum: 1,
41
+        pageSize: 999,
42
+        isMiniapp: 1,
43
+        status: 1,
44
+        name: e
45
+      },
46
+    }).then(data => {
47
+      setList(data.records || [])
48
+
49
+      updateGroup(value ? undefined : value);
50
+    })
51
+  }
52
+
53
+  if (value !== group.groupId) {
54
+    updateGroup(value);
55
+  }
56
+
57
+  const handleChange = val => {
58
+    onChange(val)
59
+  }
60
+
61
+  const setData = val => {
62
+    updateGroup(val)
63
+    onChange(val)
64
+    setVisible(false)
65
+  }
66
+
67
+  const clearVal = val => {
68
+    onChange(val)
69
+    setVisible(false)
70
+  }
71
+
72
+  const columns = [
73
+    {
74
+      title: '标题',
75
+      dataIndex: 'name',
76
+      key: 'drainageId',
77
+      align: 'center',
78
+      ellipsis: true,
79
+      render: text => <a>{text}</a>,
80
+    },
81
+    {
82
+      title: '操作',
83
+      align: 'center',
84
+      width: '20%',
85
+      render: (text, record) => (
86
+        <span>
87
+          <a onClick={() => setData(record.drainageId)} style={{ color: 'blue' }}>选择</a>
88
+        </span>
89
+      ),
90
+    },
91
+  ];
92
+
93
+  return (
94
+    <div>
95
+      <div onClick={() => setVisible(true)}>{group.groupName}</div>
96
+      <Modal
97
+        title="请选择"
98
+        visible={visible}
99
+        onCancel={() => setVisible(false)}
100
+        footer={[]}
101
+      >
102
+        <Row>
103
+          <Col span={18}>
104
+            <Search
105
+              placeholder="请输入标题"
106
+              enterButton="搜索"
107
+              size="default"
108
+              allowClear="true"
109
+              onSearch={value => searchH5(value)}
110
+              style={{ marginBottom: '16px' }}
111
+            />
112
+          </Col>
113
+          <Col span={4} offset={1}>
114
+            <Button type="primary" onClick={()=>clearVal('')}>清除选择</Button>
115
+          </Col>
116
+        </Row>
117
+
118
+        <Table rowKey={list => list.drainageId} columns={columns} dataSource={list} />
119
+
120
+      </Modal>
121
+    </div>
122
+  )
123
+}

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

@@ -1,6 +1,8 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Select, Modal } from 'antd';
2
+
3
+import { Form, Select, Modal, Button, Table, Divider, Tag, Input } from 'antd';
3 4
 import { apis, fetch } from '../../utils/request';
5
+const { Search } = Input;
4 6
 
5 7
 const getHelpList = fetch(apis.helpActivity.effectiveList)
6 8
 
@@ -28,6 +30,7 @@ export default props => {
28 30
         buildingId,
29 31
         pageNum: 1,
30 32
         pageSize: 999,
33
+        status: 1
31 34
       },
32 35
     }).then(data => {
33 36
       setList(data.records || [])
@@ -35,7 +38,21 @@ export default props => {
35 38
       updateHelp(value ? undefined : value);
36 39
     })
37 40
   }, [buildingId]);
41
+  const searchHelp = (e) => {
42
+    getHelpList({
43
+      params: {
44
+        buildingId,
45
+        pageNum: 1,
46
+        pageSize: 999,
47
+        status: 1,
48
+        name: e
49
+      },
50
+    }).then(data => {
51
+      setList(data.records || [])
38 52
 
53
+      updateHelp(value ? undefined : value);
54
+    })
55
+  }
39 56
   if (value !== help.helpId) {
40 57
     updateHelp(value);
41 58
   }
@@ -44,32 +61,50 @@ export default props => {
44 61
     onChange(val)
45 62
   }
46 63
 
64
+  const setData = val => {
65
+    updateHelp(val)
66
+    onChange(val)
67
+    setVisible(false)
68
+  }
69
+
70
+  const columns = [
71
+    {
72
+      title: '标题',
73
+      dataIndex: 'title',
74
+      key: 'helpActivityId',
75
+      align: 'center',
76
+      ellipsis: true,
77
+      render: text => <a>{text}</a>,
78
+    },
79
+    {
80
+      title: '操作',
81
+      align: 'center',
82
+      width: '20%',
83
+      render: (text, record) => (
84
+        <span>
85
+          <a onClick={() => setData(record.helpActivityId)} style={{ color: 'blue' }}>选择</a>
86
+        </span>
87
+      ),
88
+    },
89
+  ];
90
+
47 91
   return (
48 92
     <div>
49 93
       <div onClick={() => setVisible(true)}>{help.helpName}</div>
50 94
       <Modal
51
-        title="请选择助力"
95
+        title="请选择"
52 96
         visible={visible}
53
-        onOk={() => {
54
-          updateHelp(value)
55
-          onChange(value)
56
-          setVisible(false)
57
-        }}
58 97
         onCancel={() => setVisible(false)}
98
+        footer={[]}
59 99
       >
60
-        <Select
61
-          placeholder="请选择助力"
62
-          showSearch
63
-          value={value ? parseInt(value) : undefined}
64
-          onChange={handleChange}
65
-          style={{ width: '90%' }}
66
-          filterOption={(input, option) =>
67
-            option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
68
-          }>
69
-          {
70
-            list.map(x => (<Select.Option key={x.helpActivityId} value={x.helpActivityId}>{x.title}</Select.Option>))
71
-          }
72
-        </Select>
100
+        <Search
101
+          placeholder="请输入标题"
102
+          enterButton="搜索"
103
+          size="large"
104
+          onSearch={value => searchHelp(value)}
105
+          style={{ marginBottom: '16px' }}
106
+        />
107
+        <Table rowKey={list => list.helpActivityId} columns={columns} dataSource={list} />
73 108
       </Modal>
74 109
     </div>
75 110
   );

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

@@ -1,8 +1,9 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Select, Modal } from 'antd';
2
+import { Form, Select, Modal, Button, Table, Divider, Tag, Input } from 'antd';
3 3
 import { apis, fetch } from '../../utils/request';
4 4
 
5 5
 const getNewsList = fetch(apis.news.getList)
6
+const { Search } = Input;
6 7
 
7 8
 export default props => {
8 9
   const {
@@ -25,6 +26,7 @@ export default props => {
25 26
         buildingId,
26 27
         pageNum: 1,
27 28
         pageSize: 999,
29
+        newsStatus: 0,
28 30
       },
29 31
     }).then(data => {
30 32
       setList(data.records || [])
@@ -32,7 +34,21 @@ export default props => {
32 34
       updateNews(buildingId ? undefined : value);
33 35
     })
34 36
   }, [buildingId]);
37
+  const searchActivity = (e) => {
38
+    getNewsList({
39
+      params: {
40
+        buildingId,
41
+        pageNum: 1,
42
+        pageSize: 999,
43
+        newsStatus: 0,
44
+        title: e
45
+      },
46
+    }).then(data => {
47
+      setList(data.records || [])
35 48
 
49
+      updateNews(buildingId ? undefined : value);
50
+    })
51
+  }
36 52
   if (value !== news.newsId) {
37 53
     updateNews(value);
38 54
   }
@@ -41,33 +57,50 @@ export default props => {
41 57
     onChange(val)
42 58
   }
43 59
 
44
-  console.log(value, typeof value)
60
+  const setData = val => {
61
+    updateNews(val)
62
+    onChange(val)
63
+    setVisible(false)
64
+  }
65
+
66
+  const columns = [
67
+    {
68
+      title: '标题',
69
+      dataIndex: 'newsName',
70
+      key: 'newsId',
71
+      align: 'center',
72
+      ellipsis: true,
73
+      render: text => <a>{text}</a>,
74
+    },
75
+    {
76
+      title: '操作',
77
+      align: 'center',
78
+      width: '20%',
79
+      render: (text, record) => (
80
+        <span>
81
+          <a onClick={() => setData(record.newsId)} style={{ color: 'blue' }}>选择</a>
82
+        </span>
83
+      ),
84
+    },
85
+  ];
86
+
45 87
   return (
46 88
     <div>
47 89
       <div onClick={() => setVisible(true)}>{news.newsName}</div>
48 90
       <Modal
49
-        title="请选择资讯"
91
+        title="请选择"
50 92
         visible={visible}
51
-        onOk={() => {
52
-          updateNews(value)
53
-          onChange(value)
54
-          setVisible(false)
55
-        }}
56 93
         onCancel={() => setVisible(false)}
94
+        footer={[]}
57 95
       >
58
-        <Select
59
-          showSearch
60
-          value={value ? parseInt(value) : undefined}
61
-          onChange={handleChange}
62
-          style={{ width: '90%' }}
63
-          filterOption={(input, option) =>
64
-            option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
65
-          }
66
-        >
67
-          {
68
-            list.map(x => (<Select.Option key={x.newsId} value={x.newsId}>{x.newsName}</Select.Option>))
69
-          }
70
-        </Select>
96
+        <Search
97
+          placeholder="请输入标题"
98
+          enterButton="搜索"
99
+          size="large"
100
+          onSearch={value => searchActivity(value)}
101
+          style={{ marginBottom: '16px' }}
102
+        />
103
+        <Table rowKey={list => list.newsId} columns={columns} dataSource={list} />
71 104
       </Modal>
72 105
     </div>
73 106
   );

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

@@ -49,11 +49,24 @@ const toEdit = (contentId) => () => {
49 49
       render: (image) => <img src={image} className={styles.imgSmall} />,
50 50
     },
51 51
     {
52
-      title: '类型',
52
+      title: '发布城市',
53
+      dataIndex: 'cityName',
54
+      key: 'cityName',
55
+      align: 'center',
56
+    },
57
+    {
58
+      title: '关联项目',
59
+      dataIndex: 'buildingName',
60
+      key: 'buildingName',
61
+      align: 'center',
62
+      render: (buildingName) => <span>{ buildingName === null ? '无' : buildingName }</span>
63
+    },
64
+    {
65
+      title: '关联内容类型',
53 66
       dataIndex: 'contentType',
54 67
       key: 'contentType',
55 68
       align: 'center',
56
-      render: (contentType) => <span>{ contentType === 'project' ? '项目' : contentType === 'activity' ? '活动' : contentType === 'news' ? '资讯' : contentType === 'other' ? '其他' : contentType === 'help' ? '助力' : contentType === 'group' ? '拼团' : '' }</span>
69
+      render: (contentType) => <span>{ contentType === 'project' ? '项目' : contentType === 'activity' ? '活动' : contentType === 'news' ? '资讯' : contentType === 'other' ? '其他' : contentType === 'help' ? '助力' : contentType === 'group' ? '拼团' : contentType === 'h5' ? 'H5活动' : '无' }</span>
57 70
     },
58 71
     // {
59 72
     //   title: '发布位置',
@@ -74,7 +87,7 @@ const toEdit = (contentId) => () => {
74 87
       dataIndex: 'status',
75 88
       key: 'status',
76 89
       align: 'center',
77
-      render: (status)=> <><span>{status == 1 ? '启用' : '停用'}</span></>
90
+      render: (status)=> <><span>{status == 1 ? '上架' : '下架'}</span></>
78 91
     },
79 92
     {
80 93
       title: '操作',
@@ -83,9 +96,14 @@ const toEdit = (contentId) => () => {
83 96
       align: 'center',
84 97
       render: (x,row) => (
85 98
         <>
86
-          <AuthButton name="admin.extendContent.id.put" noRight={null}>
87
-            <span style={{ color: '#1990FF', marginRight: '20px',cursor: 'pointer' }} onClick={changeStatus(row)}>{ row.status === 1 ? '禁用' : '启用' }<Icon type="vertical-align-top" className={styles.edit} /></span>
88
-            <span style={{ color: '#FF925C',cursor: 'pointer' }} onClick={toEdit(row.contentId)}>编辑<Icon type="form" className={styles.edit} /></span>
99
+          <AuthButton name="admin.advert.publish" noRight={null}>
100
+            <span style={{ color: '#1990FF', marginRight: '20px',cursor: 'pointer' }} onClick={changeStatus(row)}>{ row.status === 1 ? '下架' : '上架' }<Icon type="vertical-align-top" className={styles.edit} /></span>
101
+          </AuthButton>
102
+          <AuthButton name="admin.advert.put" noRight={null}>
103
+            <span style={{ color: '#FF925C', marginRight: '20px', cursor: 'pointer' }} onClick={toEdit(row.contentId)}>编辑<Icon type="form" className={styles.edit} /></span>
104
+          </AuthButton>
105
+          <AuthButton name="admin.advert.delete" noRight={null}>
106
+            <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={deleteCarouse(row.contentId)}>删除<Icon type="vertical-align-top" className={styles.edit} /></span>
89 107
           </AuthButton>
90 108
         </>
91 109
       )
@@ -110,16 +128,35 @@ const toEdit = (contentId) => () => {
110 128
         });
111 129
   }
112 130
   
131
+  //删除
132
+const deleteCarouse = (contentId) => () =>{
133
+  Modal.confirm({
134
+    title: '确认删除此数据?',
135
+    okText: '确定',
136
+    cancelText: '取消',
137
+    onOk() {
138
+      request({ ...apis.carsuseFigure.deleteExtendContent,urlData:{id: contentId}}).then((data) => {
139
+            message.info('操作成功!')
140
+            getList({ pageNum: 1, pageSize: 10, showType: 'screen' })
141
+        }).catch((err) => {
142
+            console.log(err)
143
+            message.info(err.msg || err.message)
144
+        })
145
+    },
146
+  });
147
+}
148
+
113 149
 //   停用启用
114 150
   const changeStatus = (row) => () => {
115 151
       console.log(row)
116 152
       if(row.status === 0) {
117
-        row.status = 1
153
+        
118 154
         Modal.confirm({
119 155
           title: '确认发布此数据?',
120 156
           okText: '确定',
121 157
           cancelText: '取消',
122 158
           onOk() {
159
+            row.status = 1
123 160
               request({ ...apis.carsuseFigure.updataExtendContent,urlData:{id: row.contentId}, data: row,}).then((data) => {
124 161
                   message.info('操作成功!')
125 162
                   getList({ pageNum: 1, pageSize: 10, showType: 'screen' })
@@ -130,12 +167,13 @@ const toEdit = (contentId) => () => {
130 167
           },
131 168
         });
132 169
       }else if(row.status === 1){
133
-        row.status = 0
170
+        
134 171
         Modal.confirm({
135 172
           title: '停用后不会再显示在小程序端',
136 173
           okText: '确定',
137 174
           cancelText: '取消',
138 175
           onOk() {
176
+            row.status = 0
139 177
               request({ ...apis.carsuseFigure.updataExtendContent,urlData:{id: row.contentId}, data: row,}).then((data) => {
140 178
                   message.info('操作成功!')
141 179
                   getList({ pageNum: 1, pageSize: 10, showType: 'screen' })
@@ -149,8 +187,12 @@ const toEdit = (contentId) => () => {
149 187
 
150 188
   }
151 189
   
152
-  const changePageNum = (pageNumber) => {
153
-      getList({ pageNum: pageNumber, pageSize: 10, showType: 'screen' })
190
+  const changePageNum = (pageNumber, props) => {
191
+    props.form.validateFields((err, values) => {
192
+      if (!err) {
193
+        getList({ pageNum: pageNumber, pageSize: 10, ...values, showType: 'screen' })
194
+      }
195
+    });
154 196
   }
155 197
 
156 198
   // 提交事件
@@ -175,6 +217,11 @@ const handleSubmit = (e, props) => {
175 217
 
176 218
     <>
177 219
       <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
220
+      <Form.Item>
221
+          {getFieldDecorator('cityId')(
222
+             <SelectCity />,
223
+          )}
224
+        </Form.Item>
178 225
         <Form.Item>
179 226
           {getFieldDecorator('buildingId')(
180 227
             <BuildSelect />,
@@ -186,7 +233,10 @@ const handleSubmit = (e, props) => {
186 233
               <Option value="activity">活动</Option>
187 234
               <Option value="project">项目</Option>
188 235
               <Option value="news">资讯</Option>
189
-              <Option value="other">其他</Option>
236
+              <Option value="help">助力</Option>
237
+              <Option value="group">拼团</Option>
238
+              <Option value="h5">H5</Option>
239
+              <Option value="nothing">无</Option>
190 240
             </Select>,
191 241
           )}
192 242
         </Form.Item>
@@ -201,26 +251,28 @@ const handleSubmit = (e, props) => {
201 251
         <Form.Item>
202 252
           {getFieldDecorator('status')(
203 253
             <Select style={{ width: '180px' }} placeholder="状态">
204
-              <Option value="1">启用</Option>
205
-              <Option value="0">停用</Option>
254
+              <Option value="1">已上架</Option>
255
+              <Option value="0">已下架</Option>
206 256
             </Select>,
207 257
           )}
208 258
         </Form.Item>
209 259
         <Form.Item>
260
+        <AuthButton name="admin.advert.search" noRight={null}>
210 261
           <Button type="primary" htmlType="submit" className={styles.searchBtn}>
211 262
             搜索
212 263
           </Button>
264
+          </AuthButton>
213 265
           <Button style={{ marginLeft: 8 }} onClick={handleReset}>
214 266
               重置
215 267
             </Button>
216 268
         </Form.Item>
217 269
       </Form>
218
-      <AuthButton name="admin.extendContent.post" noRight={null}>
270
+      <AuthButton name="admin.advert.post" noRight={null}>
219 271
         <Button type="danger" className={styles.addBtn} onClick={toEdit()}>新增</Button>
220 272
       </AuthButton>
221 273
       <Table dataSource={data.records} columns={columns} pagination={false} rowKey="advertisingList"/>
222 274
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
223
-        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current}/>
275
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={e => changePageNum(e,props)} current={data.current}/>
224 276
       </div>
225 277
     </>
226 278
   )

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

@@ -49,11 +49,24 @@ const toEditCarouse = (contentId) => () => {
49 49
       render: (x, row) => <img src={row.image} className={row.showPosition === 'index' ? styles.imgIndex : row.showPosition === 'mall' ? styles.imgPerfect : ''} />,
50 50
     },
51 51
     {
52
-      title: '类型',
52
+      title: '发布城市',
53
+      dataIndex: 'cityName',
54
+      key: 'cityName',
55
+      align: 'center',
56
+    },
57
+    {
58
+      title: '关联项目',
59
+      dataIndex: 'buildingName',
60
+      key: 'buildingName',
61
+      align: 'center',
62
+      render: (buildingName) => <span>{ buildingName === null ? '无' : buildingName }</span>
63
+    },
64
+    {
65
+      title: '关联内容类型',
53 66
       dataIndex: 'contentType',
54 67
       key: 'contentType',
55 68
       align: 'center',
56
-      render: (contentType) => <span>{ contentType === 'project' ? '项目' : contentType === 'activity' ? '活动' : contentType === 'news' ? '资讯' : contentType === 'other' ? '其他' : contentType === 'help' ? '助力' : contentType === 'group' ? '拼团' : '' }</span>
69
+      render: (contentType) => <span>{ contentType === 'project' ? '项目' : contentType === 'activity' ? '活动' : contentType === 'news' ? '资讯' : contentType === 'other' ? '其他' : contentType === 'help' ? '助力' : contentType === 'group' ? '拼团' : contentType === 'h5' ? 'H5活动' : '无' }</span>
57 70
     },
58 71
     {
59 72
       title: '发布位置',
@@ -74,7 +87,7 @@ const toEditCarouse = (contentId) => () => {
74 87
       dataIndex: 'status',
75 88
       key: 'status',
76 89
       align: 'center',
77
-      render: (status)=> <><span>{status == 1 ? '启用' : '停用'}</span></>
90
+      render: (status)=> <><span>{status == 1 ? '已上架' : '已下架'}</span></>
78 91
     },
79 92
     {
80 93
       title: '操作',
@@ -83,9 +96,14 @@ const toEditCarouse = (contentId) => () => {
83 96
       align: 'center',
84 97
       render: (x,row) => (
85 98
         <>
99
+          <AuthButton name="admin.extendContent.publish" noRight={null}>
100
+            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer'}} onClick={changeStatus(row)}>{ row.status === 1 ? '下架' : '上架' }<Icon type="vertical-align-top" className={styles.edit} /></span>
101
+          </AuthButton>
86 102
           <AuthButton name="admin.extendContent.id.put" noRight={null}>
87
-            <span style={{ color: '#1990FF', marginRight: '20px',cursor: 'pointer' }} onClick={changeStatus(row)}>{ row.status === 1 ? '禁用' : '启用' }<Icon type="vertical-align-top" className={styles.edit} /></span>
88
-            <span style={{ color: '#FF925C',cursor: 'pointer' }} onClick={toEditCarouse(row.contentId)}>编辑<Icon type="form" className={styles.edit} /></span>
103
+            <span style={{ color: '#FF925C', marginRight: '20px', cursor: 'pointer' }} onClick={toEditCarouse(row.contentId)}>编辑<Icon type="form" className={styles.edit} /></span>
104
+          </AuthButton>
105
+          <AuthButton name="admin.extendContent.delete" noRight={null}>
106
+            <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={deleteCarouse(row.contentId)}>删除<Icon type="vertical-align-top" className={styles.edit} /></span>
89 107
           </AuthButton>
90 108
         </>
91 109
       )
@@ -110,37 +128,59 @@ const toEditCarouse = (contentId) => () => {
110 128
         });
111 129
   }
112 130
   
131
+//删除
132
+const deleteCarouse = (contentId) => () =>{
133
+  Modal.confirm({
134
+    title: '确认删除此数据?',
135
+    okText: '确定',
136
+    cancelText: '取消',
137
+    onOk() {
138
+      request({ ...apis.carsuseFigure.deleteExtendContent,urlData:{id: contentId}}).then((data) => {
139
+            message.info('操作成功!')
140
+            getList({ pageNum: 1, pageSize: 10, showType: 'banner' })
141
+        }).catch((err) => {
142
+            console.log(err)
143
+            message.info(err.msg || err.message)
144
+        })
145
+    },
146
+  });
147
+}
148
+
113 149
 //   停用启用
114 150
   const changeStatus = (row) => () => {
115 151
       console.log(row)
116 152
       if(row.status === 0) {
117
-        row.status = 1
153
+        
118 154
         Modal.confirm({
119 155
           title: '确认发布此数据?',
120 156
           okText: '确定',
121 157
           cancelText: '取消',
122 158
           onOk() {
159
+            row.status = 1
123 160
             request({ ...apis.carsuseFigure.updataExtendContent,urlData:{id: row.contentId}, data: row,}).then((data) => {
124 161
                   message.info('操作成功!')
125 162
                   getList({ pageNum: 1, pageSize: 10, showType: 'banner' })
126 163
               }).catch((err) => {
127 164
                   console.log(err)
165
+                  row.status = 0
128 166
                   message.info(err.msg || err.message)
129 167
               })
130 168
           },
131 169
         });
132 170
       }else if(row.status === 1){
133
-        row.status = 0
171
+        
134 172
         Modal.confirm({
135 173
           title: '停用后不会再显示在小程序端',
136 174
           okText: '确定',
137 175
           cancelText: '取消',
138 176
           onOk() {
177
+            row.status = 0
139 178
             request({ ...apis.carsuseFigure.updataExtendContent,urlData:{id: row.contentId}, data: row,}).then((data) => {
140 179
                   message.info('操作成功!')
141 180
                   getList({ pageNum: 1, pageSize: 10, showType: 'banner' })
142 181
               }).catch((err) => {
143 182
                   console.log(err)
183
+                  row.status = 1
144 184
                   message.info(err.msg || err.message)
145 185
               })
146 186
           },
@@ -150,7 +190,7 @@ const toEditCarouse = (contentId) => () => {
150 190
   }
151 191
   
152 192
   const changePageNum = (pageNumber) => {
153
-      getList({ pageNum: pageNumber, pageSize: 10, showType: 'banner' })
193
+      getList({ pageNum: pageNumber, pageSize: 10, showType: 'banner', ...props.form.getFieldsValue() })
154 194
   }
155 195
 
156 196
   // 提交事件
@@ -174,6 +214,11 @@ const handleSubmit = (e, props) => {
174 214
 
175 215
     <>
176 216
       <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
217
+        <Form.Item>
218
+          {getFieldDecorator('cityId')(
219
+             <SelectCity />,
220
+          )}
221
+        </Form.Item>
177 222
         <Form.Item>
178 223
           {getFieldDecorator('buildingId')(
179 224
             <BuildSelect />,
@@ -185,6 +230,10 @@ const handleSubmit = (e, props) => {
185 230
               <Option value="activity">活动</Option>
186 231
               <Option value="project">项目</Option>
187 232
               <Option value="news">资讯</Option>
233
+              <Option value="help">助力</Option>
234
+              <Option value="group">拼团</Option>
235
+              <Option value="h5">H5</Option>
236
+              <Option value="nothing">无</Option>
188 237
               {/* <Option value="other">其他</Option> */}
189 238
             </Select>,
190 239
           )}
@@ -200,15 +249,17 @@ const handleSubmit = (e, props) => {
200 249
         <Form.Item>
201 250
           {getFieldDecorator('status')(
202 251
             <Select style={{ width: '180px' }} placeholder="状态">
203
-              <Option value="1">启用</Option>
204
-              <Option value="0">停用</Option>
252
+              <Option value="1">已上架</Option>
253
+              <Option value="0">已下架</Option>
205 254
             </Select>,
206 255
           )}
207 256
         </Form.Item>
208 257
         <Form.Item>
258
+        <AuthButton name="admin.extendContent.search" noRight={null}>
209 259
           <Button type="primary" htmlType="submit" className={styles.searchBtn}>
210 260
             搜索
211 261
           </Button>
262
+          </AuthButton>
212 263
           <Button style={{ marginLeft: 8 }} onClick={handleReset}>
213 264
               重置
214 265
             </Button>

+ 128
- 0
src/pages/carouselFigure/customImg/edit.jsx Прегледај датотеку

@@ -0,0 +1,128 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Input, Menu, Dropdown, Button, Icon, message, Table, Divider, Tag, Select, Form, Alert } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import channels from '../../channel/channelList.less';
5
+import { connect } from 'dva';
6
+import BuildSelect from '../../../components/SelectButton/BuildSelect'
7
+import { createForm, FieldTypes } from '../../../components/XForm';
8
+import Wangedit from '../../../components/Wangedit/Wangedit'
9
+import router from 'umi/router';
10
+import apis from '../../../services/apis';
11
+import request from '../../../utils/request'
12
+
13
+const { TextArea } = Input;
14
+const { Option } = Select;
15
+
16
+let activityVisible = true
17
+
18
+const setExtraData = (data) => {
19
+    console.log(data, 'data');
20
+    activityVisible = data.imgType === 'index';
21
+  }
22
+
23
+const handleFormValueChange = (props, changedValues, allValues) => {
24
+    setExtraData(allValues)
25
+}
26
+
27
+const XForm = createForm({ onValuesChange: handleFormValueChange })
28
+
29
+const header = props => {
30
+  const {
31
+    currentUser = {
32
+      avatar: '',
33
+      userName: '',
34
+    },
35
+    menu,
36
+  } = props;
37
+
38
+  const imgId = props.location.query.imgId
39
+  const [ data, setData ] = useState({'imgUrl':'https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1574145199853-97feda7895c65be33aa234a7b81b37f.jpg','imgType':'index','imgDesc':'小程序首页分享配图','imgDocument': currentUser.orgName+' 精准获客平台'})
40
+  if(imgId){
41
+    useEffect(() => {
42
+      getData(imgId);
43
+    },[])
44
+
45
+  // 查询列表
46
+  const getData = (imgId) => {
47
+    request({ ...apis.carsuseFigure.getCustomImg, urlData: { id: imgId} }).then((data) => {
48
+        console.log(data)
49
+        if (data.imgType === 'index'){
50
+            activityVisible = true;
51
+        }else{
52
+            activityVisible = false;
53
+        }
54
+        setData(data)
55
+    })
56
+  }
57
+  }
58
+
59
+  const fields = [
60
+    {
61
+      label: '图片',
62
+      name: 'imgUrl',
63
+      type: FieldTypes.ImageUploader,
64
+      value: data.imgUrl,
65
+      help: '建议图片尺寸:750*600px,比例5:4,格式:jpg,用于:首页分享',
66
+      rules: [
67
+        {required: true, message: '请选择图片'},
68
+      ]
69
+    },
70
+    {
71
+      label: '类型',
72
+      name: 'imgType',
73
+      type: FieldTypes.Select,
74
+      value: 'index',
75
+      dict: [{
76
+          label: '首页分享',
77
+          value: 'index',
78
+        },
79
+      ],
80
+      rules: [
81
+        { required: true, message: '请选择类型' },
82
+      ],
83
+    },
84
+    {
85
+      label: '分享文案',
86
+      name: 'imgDocument',
87
+      type: FieldTypes.Text,
88
+      value: data.imgDocument,
89
+      rules: [
90
+        { required: true, message: '请输入分享文案' },
91
+      ],
92
+    },
93
+  ]
94
+
95
+  const handleSubmit = values => {
96
+    
97
+    if (imgId) {
98
+      values.imgId = imgId
99
+      request({ ...apis.carsuseFigure.updateCustomImg, data: values,}).then((data) => {
100
+        cancelPage()
101
+      }).catch((err) => {
102
+        message.info(err.msg || err.message)
103
+      })
104
+      }else{
105
+      request({ ...apis.carsuseFigure.addCustomImg, data: values,}).then((data) => {
106
+        cancelPage()
107
+      }).catch((err) => {
108
+        message.info(err.msg || err.message)
109
+      })
110
+      }
111
+  }
112
+
113
+  const cancelPage = () => {
114
+    router.push({
115
+        pathname: '/carouselFigure/customImg/list',
116
+    });
117
+  }
118
+
119
+  return (
120
+    <XForm onSubmit={handleSubmit} onCancel={cancelPage} fields={fields}></XForm>
121
+  )
122
+}
123
+
124
+const WrappedNormalLoginForm = Form.create({ name: 'header' })(header);
125
+
126
+export default connect(({ user }) => ({
127
+  currentUser: user.currentUser,
128
+}))(WrappedNormalLoginForm);

+ 79
- 0
src/pages/carouselFigure/customImg/list.jsx Прегледај датотеку

@@ -0,0 +1,79 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal,Breadcrumb } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import styles from '../../style/GoodsList.less';
5
+import router from 'umi/router';
6
+import BuildSelect from '../../../components/SelectButton/BuildSelect'
7
+import apis from '../../../services/apis';
8
+import request from '../../../utils/request'
9
+import AuthButton from '@/components/AuthButton';
10
+
11
+const { Option } = Select;
12
+const { Column } = Table;
13
+
14
+function header(props) {
15
+  // 获取初始化数据
16
+  const [ data, setData ] = useState([])
17
+
18
+  useEffect(() => {
19
+    getList({ pageNum: 1, pageSize: 10 });
20
+  },[])
21
+
22
+  // 查询列表
23
+  const getList = (params) => {
24
+    request({ ...apis.carsuseFigure.customImg, params: { ...params },}).then((data) => {
25
+        console.log(data,"datadata")
26
+        if(data.records.length > 0){
27
+          setData(data.records)
28
+        }else{
29
+          setData([{'imgUrl':'https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1574145199853-97feda7895c65be33aa234a7b81b37f.jpg','imgType':'index','imgDesc':'小程序首页分享配图'}])
30
+        }
31
+        
32
+    })
33
+  }
34
+  
35
+    // 跳转到编辑商品
36
+  const toEditCustom = (imgId) => () => {
37
+    router.push({
38
+      pathname: '/carouselFigure/customImg/edit',
39
+      query: {
40
+        imgId
41
+      },
42
+    });
43
+  }
44
+
45
+ 
46
+  // const { getFieldDecorator } = props.form
47
+  return (
48
+
49
+    <>
50
+      <Table dataSource={data}>
51
+        <Column title="图片" dataIndex="imgUrl" key="imgUrl" 
52
+        render={(text, record) => (
53
+        <img src={record.imgUrl} height="120px" width="150px" />
54
+        )}/>
55
+        <Column title="类型" dataIndex="imgType" key="imgType" 
56
+        render={(text, record) => (
57
+          <span>
58
+            {record.imgType === 'index' ?'首页分享':'请编辑'}
59
+          </span>
60
+          )}
61
+        />
62
+        <Column title="说明" dataIndex="imgDesc" key="imgDesc" />
63
+        <Column title="操作" 
64
+        dataIndex="handle" 
65
+        key="handle" 
66
+        render={(text, record) => (
67
+          <AuthButton name="admin.custom.put" noRight={null}>
68
+            <span style={{ color: '#FF925C', cursor: 'pointer' }} onClick={toEditCustom(record.imgId)}>
69
+              编辑<Icon type="form" className={styles.edit} />
70
+            </span>
71
+          </AuthButton>
72
+          )}/>/>
73
+      </Table>,
74
+    </>
75
+  )
76
+}
77
+const WrappedHeader = Form.create({ name: 'header' })(header);
78
+
79
+export default WrappedHeader

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

@@ -5,6 +5,7 @@ import styles from '../style/GoodsList.less';
5 5
 import moment from 'moment';
6 6
 import router from 'umi/router';
7 7
 import BuildSelect from '../../components/SelectButton/BuildSelect'
8
+import CitySelect from '../../components/SelectButton/CitySelect2'
8 9
 import { FieldTypes, createForm } from '../../components/XForm';
9 10
 import Wangedit from '../../components/Wangedit/Wangedit';
10 11
 import SelectActivity from './SelectActivity';
@@ -13,7 +14,7 @@ import apis from '../../services/apis';
13 14
 import request from '../../utils/request'
14 15
 import SelectHelp from './SelectHelp';
15 16
 import SelectGroup from './SelectGroup';
16
-
17
+import SelectH5 from './SelectH5';
17 18
 /**
18 19
  *
19 20
  *
@@ -27,19 +28,45 @@ import SelectGroup from './SelectGroup';
27 28
   let helpVisible = false
28 29
   let groupVisible = false
29 30
   let buildingId = ''
31
+  let cityId = ''
32
+  let isHaveActive=false
33
+  let isCanChoose=true
30 34
 
31 35
   const setExtraData = (data) => {
36
+    if(data.isHaveActive!=undefined){
37
+      isHaveActive=data.isHaveActive
38
+      if(!isHaveActive) {
39
+        data.contentType=null
40
+        data.buildingId=null
41
+      }
42
+    }
43
+
32 44
     contentVisible = data.contentType === 'other';
33 45
     activityVisible = data.contentType === 'activity';
34 46
     newsVisible = data.contentType === 'news';
35 47
     helpVisible = data.contentType === 'help';
36 48
     groupVisible = data.contentType === 'group';
49
+    cityId=data.cityId
50
+    buildingId = data.buildingId
51
+  }
52
+
53
+  const setExtraData1 = (data) => {
54
+    if(data.contentType=='h5'||data.contentType==''||data.contentType=='nothing'){
55
+       isHaveActive=false
56
+    }else{
57
+       isHaveActive=true
58
+    }
37 59
 
60
+    contentVisible = data.contentType === 'other';
61
+    activityVisible = data.contentType === 'activity';
62
+    newsVisible = data.contentType === 'news';
63
+    helpVisible = data.contentType === 'help';
64
+    groupVisible = data.contentType === 'group';
38 65
     buildingId = data.buildingId
39 66
   }
40
-  
67
+
41 68
   const handleFormValueChange = (props, changedValues, allValues) => {
42
-    setExtraData(allValues)
69
+      setExtraData(allValues)
43 70
   }
44 71
 
45 72
   const XForm = createForm({ onValuesChange: handleFormValueChange })
@@ -48,37 +75,61 @@ import SelectGroup from './SelectGroup';
48 75
     const [ tab, changeTab ] = useState('basic')
49 76
     const contentId = props.location.query.contentId
50 77
     const [ data, setData ] = useState({})
51
-  
78
+
52 79
     if(contentId){
80
+      isCanChoose=false
53 81
       useEffect(() => {
54 82
         getDetail(contentId);
55 83
       },[])
56
-  
84
+
57 85
       // 查询列表
58 86
       const getDetail = (contentId) => {
59 87
         request({ ...apis.carsuseFigure.getExtendContent,urlData:{id: contentId}}).then((data) => {
60
-          setExtraData(data)
88
+          setExtraData1(data)
61 89
           setData(data)
62 90
         })
63 91
       }
92
+    }else{
93
+      isCanChoose=true
64 94
     }
65
-  
95
+
66 96
     const cancelPage = () =>{
67 97
       router.push({
68 98
         pathname: '/carouselFigure/advertisingList',
69 99
       });
70 100
     }
71
-   
101
+
72 102
     const fields = [
103
+      {
104
+        label: '是否关联项目',
105
+        name: 'isHaveActive',
106
+        type: FieldTypes.Switch,
107
+        value:isHaveActive,
108
+        hidden: () => !isCanChoose,
109
+        rules: [
110
+          { required: true,message: '是否城市活动' },
111
+        ],
112
+      },
73 113
       {
74 114
         label: '所属项目',
75 115
         name: 'buildingId',
76 116
         render: <BuildSelect />,
77 117
         value: data.buildingId,
118
+        hidden: () => !isHaveActive,
78 119
         rules: [
79 120
           { required: true, message: '请选择所属项目' },
80 121
         ],
81 122
       },
123
+      {
124
+        label: '展示城市',
125
+        name: 'cityId',
126
+        render: <CitySelect />,
127
+        hidden: () => isHaveActive,
128
+        value: data.cityId,
129
+        rules: [
130
+          { required: true, message: '请选择展示城市' },
131
+        ],
132
+      },
82 133
       {
83 134
         label: '开屏广告',
84 135
         name: 'image',
@@ -89,10 +140,21 @@ import SelectGroup from './SelectGroup';
89 140
           { required: true, message: '请上传图片' },
90 141
         ],
91 142
       },
143
+      {
144
+        label: '是否发布H5',
145
+        name: 'targetId',
146
+        render: <SelectH5/>,
147
+        hidden: () => isHaveActive,
148
+        value: data.targetId,
149
+        rules: [
150
+          { required: false, message: '请选择发布H5' },
151
+        ],
152
+      },
92 153
       {
93 154
         label: '标题',
94 155
         name: 'title',
95 156
         type: FieldTypes.Text,
157
+        hidden: true,
96 158
         value: data.title,
97 159
         rules: [
98 160
           { required: true, message: '请输入标题' },
@@ -101,6 +163,7 @@ import SelectGroup from './SelectGroup';
101 163
       {
102 164
         label: '类型',
103 165
         name: 'contentType',
166
+        hidden: () => !isHaveActive,
104 167
         type: FieldTypes.Select,
105 168
         dict: [{
106 169
           label: '常规活动',
@@ -114,10 +177,6 @@ import SelectGroup from './SelectGroup';
114 177
           label: '资讯',
115 178
           value: 'news'
116 179
         },
117
-        {
118
-          label: '其他',
119
-          value: 'other'
120
-        },
121 180
         {
122 181
           label: '拼团',
123 182
           value: 'group'
@@ -186,19 +245,27 @@ import SelectGroup from './SelectGroup';
186 245
         name: 'status',
187 246
         type: FieldTypes.Select,
188 247
         dict: [{
189
-          label: "启用",
248
+          label: "上架",
190 249
           value: 1
191 250
         },
192 251
         {
193
-          label: "停用",
252
+          label: "下架",
194 253
           value: 0
195 254
         },],
196 255
         value: data.status != null ? data.status : 1,
197 256
       },
198 257
     ]
199
-    
200
-    const handleSubmit = val => { 
258
+
259
+    const handleSubmit = val => {
201 260
       val.showType = 'screen'
261
+      if(!isHaveActive&&val.targetId) {
262
+          if(!val.contentType){
263
+            val.contentType='h5'
264
+          }
265
+      }
266
+      if(!isHaveActive&&!val.targetId){
267
+        val.contentType=''
268
+      }
202 269
       if(contentId){
203 270
         request({ ...apis.carsuseFigure.updataExtendContent,urlData:{id: contentId}, data: val,}).then((data) => {
204 271
           cancelPage()
@@ -213,12 +280,12 @@ import SelectGroup from './SelectGroup';
213 280
         })
214 281
       }
215 282
     }
216
-  
217
-  
283
+
284
+
218 285
     return (
219 286
       <XForm onSubmit={handleSubmit} onCancel={cancelPage} onValuesChange={handleFormValueChange} fields={fields}></XForm>
220 287
     );
221 288
    }
222 289
  }
223
- 
290
+
224 291
 export default createEditor()

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

@@ -5,6 +5,7 @@ import moment from 'moment';
5 5
 import router from 'umi/router';
6 6
 import styles from '../style/GoodsList.less';
7 7
 import BuildSelect from '../../components/SelectButton/BuildSelect'
8
+import CitySelect from '../../components/SelectButton/CitySelect2'
8 9
 import { createForm, FieldTypes } from '../../components/XForm';
9 10
 import Wangedit from '../../components/Wangedit/Wangedit'
10 11
 import apis from '../../services/apis';
@@ -13,6 +14,7 @@ import SelectHelp from './SelectHelp';
13 14
 import SelectGroup from './SelectGroup';
14 15
 import SelectNews from './SelectNews';
15 16
 import SelectActivity from './SelectActivity';
17
+import SelectH5 from './SelectH5';
16 18
 
17 19
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
18 20
 /**
@@ -28,16 +30,45 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
28 30
   let helpVisible = false
29 31
   let groupVisible = false
30 32
   let buildingId = ''
33
+  let cityId=''
31 34
   let locationType = false
35
+  let isHaveActive=false
36
+  let isCanChoose=true
32 37
 
33
-  const setExtraData = data => {
38
+  const setExtraData = (data) => {
34 39
     console.log(data, 'data');
40
+    if(data.isHaveActive!=undefined){
41
+      isHaveActive=data.isHaveActive
42
+      if(!isHaveActive) {
43
+        data.contentType=null
44
+        data.buildingId=null
45
+      }
46
+    }
47
+
35 48
     contentVisible = data.contentType === 'other';
36 49
     activityVisible = data.contentType === 'activity';
37 50
     newsVisible = data.contentType === 'news';
38 51
     helpVisible = data.contentType === 'help';
39 52
     groupVisible = data.contentType === 'group';
40 53
 
54
+    cityId=data.cityId
55
+    buildingId = data.buildingId
56
+    locationType = data.showPosition === 'mall';
57
+    console.log(locationType, 'locationType');
58
+  }
59
+
60
+  const setExtraData1 = (data) => {
61
+     if(data.contentType=='h5'||data.contentType==''||data.contentType=='nothing'){
62
+        isHaveActive=false
63
+     }else{
64
+        isHaveActive=true
65
+     }
66
+
67
+    contentVisible = data.contentType === 'other';
68
+    activityVisible = data.contentType === 'activity';
69
+    newsVisible = data.contentType === 'news';
70
+    helpVisible = data.contentType === 'help';
71
+    groupVisible = data.contentType === 'group';
41 72
     buildingId = data.buildingId
42 73
     locationType = data.showPosition === 'mall';
43 74
     console.log(locationType, 'locationType');
@@ -45,7 +76,7 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
45 76
 
46 77
 
47 78
   const handleFormValueChange = (props, changedValues, allValues) => {
48
-    setExtraData(allValues)
79
+      setExtraData(allValues)
49 80
   }
50 81
 
51 82
   const XForm = createForm({ onValuesChange: handleFormValueChange })
@@ -54,20 +85,24 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
54 85
     const [tab, changeTab] = useState('basic')
55 86
     const { contentId } = props.location.query
56 87
     const [data, setData] = useState({})
88
+
57 89
     if (contentId) {
90
+      isCanChoose=false
58 91
       // eslint-disable-next-line react-hooks/rules-of-hooks
59 92
       useEffect(() => {
60 93
         getDetail(contentId);
61 94
       }, [])
62 95
 
63
-    // 查询列表
64
-    const getDetail = contentId => {
65
-      request({ ...apis.carsuseFigure.getExtendContent, urlData: { id: contentId } }).then(data => {
66
-          console.log(data)
67
-          setExtraData(data)
68
-          setData(data)
69
-      })
70
-    }
96
+      // 查询列表
97
+      const getDetail = contentId => {
98
+        request({ ...apis.carsuseFigure.getExtendContent, urlData: { id: contentId } }).then(data => {
99
+            console.log(data)
100
+            setExtraData1(data)
101
+            setData(data)
102
+        })
103
+      }
104
+    }else{
105
+      isCanChoose=true
71 106
     }
72 107
 
73 108
     const cancelPage = () => {
@@ -77,15 +112,36 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
77 112
     }
78 113
 
79 114
       const fields = [
115
+        {
116
+          label: '是否关联项目',
117
+          name: 'isHaveActive',
118
+          type: FieldTypes.Switch,
119
+          value:isHaveActive,
120
+          hidden: () => !isCanChoose,
121
+          rules: [
122
+            { required: true,message: '是否城市活动' },
123
+          ],
124
+        },
80 125
         {
81 126
           label: '所属项目',
82 127
           name: 'buildingId',
83 128
           render: <BuildSelect />,
129
+          hidden: () => !isHaveActive,
84 130
           value: data.buildingId,
85 131
           rules: [
86 132
             { required: true, message: '请选择所属项目' },
87 133
           ],
88 134
         },
135
+        {
136
+          label: '展示城市',
137
+          name: 'cityId',
138
+          render: <CitySelect />,
139
+          hidden: () => isHaveActive,
140
+          value: data.cityId,
141
+          rules: [
142
+            { required: true, message: '请选择展示城市' },
143
+          ],
144
+        },
89 145
         {
90 146
           label: '发布位置',
91 147
           name: 'showPosition',
@@ -108,16 +164,27 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
108 164
           name: 'image',
109 165
           type: FieldTypes.ImageUploader,
110 166
           value: data.image,
111
-          help: () => (locationType ? '建议图片尺寸:750*420px,比例16:9,格式:jpg,用于积分商城banner轮播' : '建议图片尺寸:750*600px,比例5:4,格式:jpg,用于首页顶部banner轮播'),
167
+          help: () => (locationType ? '建议图片尺寸:750*420px,比例16:9,格式:jpg,用于积分商城banner轮播' : '建议图片尺寸:750*464px,比例1.:0.618,格式:jpg,用于:首页顶部banner轮播'),
112 168
           rules: [
113 169
             { required: true, message: '请上传轮播图' },
114 170
           ],
115 171
         },
172
+        {
173
+          label: '是否发布H5',
174
+          name: 'targetId',
175
+          render: <SelectH5/>,
176
+          hidden: () => isHaveActive,
177
+          value: data.targetId,
178
+          rules: [
179
+            { required: false, message: '请选择发布H5' },
180
+          ],
181
+        },
116 182
         {
117 183
           label: '标题',
118 184
           name: 'title',
119 185
           type: FieldTypes.Text,
120 186
           value: data.title,
187
+          hidden: true,
121 188
           rules: [
122 189
             { required: true, message: '请输入标题' },
123 190
           ],
@@ -126,6 +193,7 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
126 193
           label: '类型',
127 194
           name: 'contentType',
128 195
           type: FieldTypes.Select,
196
+          hidden: () => !isHaveActive,
129 197
           dict: [{
130 198
             label: '常规活动',
131 199
             value: 'activity',
@@ -210,11 +278,11 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
210 278
           name: 'status',
211 279
           type: FieldTypes.Select,
212 280
           dict: [{
213
-            label: '启用',
281
+            label: '上架',
214 282
             value: 1,
215 283
           },
216 284
           {
217
-            label: '停用',
285
+            label: '下架',
218 286
             value: 0,
219 287
           }],
220 288
           value: data.status != null ? data.status : 1,
@@ -222,7 +290,16 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
222 290
       ]
223 291
 
224 292
       const handleSubmit = val => {
293
+        console.log(val,"232323")
225 294
         val.showType = 'banner'
295
+        if(!isHaveActive&&val.targetId) {
296
+          if(!val.contentType){
297
+            val.contentType='h5'
298
+          }
299
+        }
300
+        if(!isHaveActive&&!val.targetId){
301
+          val.contentType=''
302
+        }
226 303
         if (contentId) {
227 304
           request({ ...apis.carsuseFigure.updataExtendContent, urlData: { id: contentId }, data: val }).then(data => {
228 305
             cancelPage()

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

@@ -0,0 +1,293 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Modal, message } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import styles from '../style/GoodsList.less';
5
+import moment from 'moment';
6
+import router from 'umi/router';
7
+import BuildSelect from '../../components/SelectButton/BuildSelect'
8
+import CitySelect from '../../components/SelectButton/CitySelect2'
9
+import { FieldTypes, createForm } from '../../components/XForm';
10
+import Wangedit from '../../components/Wangedit/Wangedit';
11
+import SelectActivity from './SelectActivity';
12
+import SelectNews from './SelectNews';
13
+import apis from '../../services/apis';
14
+import request from '../../utils/request'
15
+import SelectHelp from './SelectHelp';
16
+import SelectGroup from './SelectGroup';
17
+import SelectH5 from './SelectH5';
18
+/**
19
+ *
20
+ *
21
+ * @param {*} props
22
+ * @returns
23
+ */
24
+ const createEditor = () => {
25
+  let contentVisible = false
26
+  let activityVisible = false
27
+  let newsVisible = false
28
+  let helpVisible = false
29
+  let groupVisible = false
30
+  let buildingId = ''
31
+  let cityId = ''
32
+  let isHaveActive=false
33
+  let isCanChoose=true
34
+
35
+  const setExtraData = (data) => {
36
+    if(data.isHaveActive!=undefined){
37
+      isHaveActive=data.isHaveActive
38
+      if(!isHaveActive) {
39
+        data.contentType=null
40
+        data.buildingId=null
41
+      }
42
+    }
43
+
44
+    contentVisible = data.contentType === 'other';
45
+    activityVisible = data.contentType === 'activity';
46
+    newsVisible = data.contentType === 'news';
47
+    helpVisible = data.contentType === 'help';
48
+    groupVisible = data.contentType === 'group';
49
+    cityId=data.cityId
50
+    buildingId = data.buildingId
51
+  }
52
+
53
+  const setExtraData1 = (data) => {
54
+    console.log(data,"datadatadata")
55
+    if(data.contentType=='h5'||data.contentType==''||data.contentType=='nothing'){
56
+       isHaveActive=false
57
+    }else{
58
+       isHaveActive=true
59
+    }
60
+
61
+    contentVisible = data.contentType === 'other';
62
+    activityVisible = data.contentType === 'activity';
63
+    newsVisible = data.contentType === 'news';
64
+    helpVisible = data.contentType === 'help';
65
+    groupVisible = data.contentType === 'group';
66
+    buildingId = data.buildingId
67
+  }
68
+
69
+  const handleFormValueChange = (props, changedValues, allValues) => {
70
+      setExtraData(allValues)
71
+  }
72
+
73
+  const XForm = createForm({ onValuesChange: handleFormValueChange })
74
+
75
+  return (props) => {
76
+    const [ tab, changeTab ] = useState('basic')
77
+    const contentId = props.location.query.contentId
78
+    const [ data, setData ] = useState({})
79
+
80
+    if(contentId){
81
+      isCanChoose=false
82
+      useEffect(() => {
83
+        getDetail(contentId);
84
+      },[])
85
+
86
+      // 查询列表
87
+      const getDetail = (contentId) => {
88
+        request({ ...apis.carsuseFigure.getExtendContent,urlData:{id: contentId}}).then((data) => {
89
+          setExtraData1(data)
90
+          setData(data)
91
+        })
92
+      }
93
+    }else{
94
+      isCanChoose=true
95
+    }
96
+
97
+    const cancelPage = () =>{
98
+      router.push({
99
+        pathname: '/carouselFigure/propagandaList',
100
+      });
101
+    }
102
+
103
+    const fields = [
104
+      {
105
+        label: '是否关联项目',
106
+        name: 'isHaveActive',
107
+        type: FieldTypes.Switch,
108
+        value:isHaveActive,
109
+        hidden: () => !isCanChoose,
110
+        rules: [
111
+          { required: true,message: '是否城市活动' },
112
+        ],
113
+      },
114
+      {
115
+        label: '所属项目',
116
+        name: 'buildingId',
117
+        render: <BuildSelect />,
118
+        value: data.buildingId,
119
+        hidden: () => !isHaveActive,
120
+        rules: [
121
+          { required: true, message: '请选择所属项目' },
122
+        ],
123
+      },
124
+      {
125
+        label: '所属城市',
126
+        name: 'cityId',
127
+        render: <CitySelect />,
128
+        hidden: () => isHaveActive,
129
+        value: data.cityId,
130
+        rules: [
131
+          { required: true, message: '请选择展示城市' },
132
+        ],
133
+      },
134
+      {
135
+        label: '主图',
136
+        name: 'image',
137
+        type: FieldTypes.ImageUploader,
138
+        value: data.image,
139
+        help: '建议图片尺寸:750*188px,比例4:1,格式:jpg,用于:首页宣传位',
140
+        rules: [
141
+          { required: true, message: '请上传图片' },
142
+        ],
143
+      },
144
+      {
145
+        label: '是否发布H5',
146
+        name: 'targetId',
147
+        render: <SelectH5/>,
148
+        hidden: () => isHaveActive,
149
+        value: data.targetId,
150
+        rules: [
151
+          { required: false, message: '请选择发布H5' },
152
+        ],
153
+      },
154
+      {
155
+        label: '标题',
156
+        name: 'title',
157
+        type: FieldTypes.Text,
158
+        hidden: true,
159
+        value: data.title,
160
+        rules: [
161
+          { required: true, message: '请输入标题' },
162
+        ],
163
+      },
164
+      {
165
+        label: '类型',
166
+        name: 'contentType',
167
+        hidden: () => !isHaveActive,
168
+        type: FieldTypes.Select,
169
+        dict: [{
170
+          label: '常规活动',
171
+          value: 'activity'
172
+        },
173
+        {
174
+          label: '项目',
175
+          value: 'project'
176
+        },
177
+        {
178
+          label: '资讯',
179
+          value: 'news'
180
+        },
181
+        {
182
+          label: '拼团',
183
+          value: 'group'
184
+        },
185
+        {
186
+          label: '助力',
187
+          value: 'help'
188
+        }],
189
+        value: data.contentType,
190
+        rules: [
191
+          { required: true, message: '请选择类型' },
192
+        ],
193
+      },
194
+      {
195
+        label: '发布活动',
196
+        name: 'targetId',
197
+        render: <SelectActivity buildingId={() => buildingId} />,
198
+        hidden: () => !activityVisible,
199
+        value: data.targetId,
200
+        rules: [
201
+          { required: true, message: '请选择发布活动' },
202
+        ],
203
+      },
204
+      {
205
+        label: '发布资讯',
206
+        name: 'targetId',
207
+        render: <SelectNews buildingId={() => buildingId} />,
208
+        hidden: () => !newsVisible,
209
+        value: data.targetId,
210
+        rules: [
211
+          { required: true, message: '请选择发布资讯' },
212
+        ],
213
+      },
214
+      {
215
+        label: '发布内容',
216
+        name: 'content',
217
+        render: <Wangedit />,
218
+        value: data.content,
219
+        hidden: () => !contentVisible,
220
+        rules: [
221
+          { required: true, message: '请选择发布内容' },
222
+        ],
223
+      },
224
+      {
225
+        label: '发布助力',
226
+        name: 'targetId',
227
+        render: <SelectHelp buildingId={() => buildingId} />,
228
+        hidden: () => !helpVisible,
229
+        value: data.targetId,
230
+        rules: [
231
+          { required: true, message: '请选择发布助力' },
232
+        ],
233
+      },
234
+      {
235
+        label: '发布拼团',
236
+        name: 'targetId',
237
+        render: <SelectGroup buildingId={() => buildingId} />,
238
+        hidden: () => !groupVisible,
239
+        value: data.targetId,
240
+        rules: [
241
+          { required: true, message: '请选择发布拼团' },
242
+        ],
243
+      },
244
+      {
245
+        label: '状态',
246
+        name: 'status',
247
+        type: FieldTypes.Select,
248
+        dict: [{
249
+          label: "上架",
250
+          value: 1
251
+        },
252
+        {
253
+          label: "下架",
254
+          value: 0
255
+        },],
256
+        value: data.status != null ? data.status : 1,
257
+      },
258
+    ]
259
+
260
+    const handleSubmit = val => {
261
+      console.log(val,"valvalval")
262
+      val.showType = 'propaganda'
263
+      if(!isHaveActive&&val.targetId) {
264
+          if(!val.contentType){
265
+            val.contentType='h5'
266
+          }
267
+      }
268
+      if(!isHaveActive&&!val.targetId){
269
+        val.contentType=''
270
+      }
271
+      if(contentId){
272
+        request({ ...apis.carsuseFigure.updataExtendContent,urlData:{id: contentId}, data: val,}).then((data) => {
273
+          cancelPage()
274
+        }).catch((err) => {
275
+          message.info(err.msg || err.message)
276
+        })
277
+      }else{
278
+        request({ ...apis.carsuseFigure.addExtendContent, data: val,}).then((data) => {
279
+          cancelPage()
280
+        }).catch((err) => {
281
+          message.info(err.msg || err.message)
282
+        })
283
+      }
284
+    }
285
+
286
+
287
+    return (
288
+      <XForm onSubmit={handleSubmit} onCancel={cancelPage} onValuesChange={handleFormValueChange} fields={fields}></XForm>
289
+    );
290
+   }
291
+ }
292
+
293
+export default createEditor()

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

@@ -0,0 +1,282 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, DatePicker } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import styles from '../style/GoodsList.less';
5
+import router from 'umi/router';
6
+import moment from 'moment';
7
+import SelectCity from '../../components/SelectButton/CitySelect'
8
+import BuildSelect from '../../components/SelectButton/BuildSelect'
9
+import apis from '../../services/apis';
10
+import request from '../../utils/request';
11
+import AuthButton from '@/components/AuthButton';
12
+
13
+const { Option } = Select;
14
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
15
+
16
+const header = (props) => {
17
+  const [ data, setData ] = useState({})
18
+//   const [page, changePage] = useState({})
19
+
20
+  useEffect(() => {
21
+    getList({ pageNum: 1, pageSize: 10, showType: 'propaganda' });
22
+  },[])
23
+
24
+  // 查询列表
25
+  const getList = (params) => {
26
+    request({ ...apis.carsuseFigure.extendContent, params: { ...params },}).then((data) => {
27
+        console.log(data)
28
+        setData(data)
29
+    })
30
+  }
31
+
32
+  
33
+// 跳转到编辑商品
34
+const toEdit = (contentId) => () => {
35
+    router.push({
36
+      pathname: '/carouselFigure/propaganda',
37
+      query: {
38
+        contentId
39
+      },
40
+    });
41
+  }
42
+  
43
+  const columns = [
44
+    {
45
+      title: '主图',
46
+      dataIndex: 'image',
47
+      key: 'image',
48
+      align: 'center',
49
+      render: (image) => <img src={image} className={styles.propaganda} />,
50
+    },
51
+    {
52
+      title: '发布城市',
53
+      dataIndex: 'cityName',
54
+      key: 'cityName',
55
+      align: 'center',
56
+    },
57
+    {
58
+      title: '关联项目',
59
+      dataIndex: 'buildingName',
60
+      key: 'buildingName',
61
+      align: 'center',
62
+      render: (buildingName) => <span>{ buildingName === null ? '无' : buildingName }</span>
63
+    },
64
+    {
65
+      title: '关联内容类型',
66
+      dataIndex: 'contentType',
67
+      key: 'contentType',
68
+      align: 'center',
69
+      render: (contentType) => <span>{ contentType === 'project' ? '项目' : contentType === 'activity' ? '活动' : contentType === 'news' ? '资讯' : contentType === 'other' ? '其他' : contentType === 'help' ? '助力' : contentType === 'group' ? '拼团' : contentType === 'h5' ? 'H5活动' : '无' }</span>
70
+    },
71
+    // {
72
+    //   title: '发布位置',
73
+    //   dataIndex: 'showPosition',
74
+    //   key: 'showPosition',
75
+    //   align: 'center',
76
+    //   render: (showPosition) => <span>{ showPosition === 'index' ? '首页' : showPosition === 'mall' ? '商城' : '' }</span>
77
+    // },
78
+    {
79
+      title: '发布时间',
80
+      dataIndex: 'createDate',
81
+      key: 'createDate',
82
+      align: 'center',
83
+      render: (x, row) => <><span>{moment(row.createDate).format('YYYY-MM-DD')}</span></>
84
+    },
85
+    {
86
+      title: '状态',
87
+      dataIndex: 'status',
88
+      key: 'status',
89
+      align: 'center',
90
+      render: (status)=> <><span>{status == 1 ? '上架' : '下架'}</span></>
91
+    },
92
+    {
93
+      title: '操作',
94
+      dataIndex: 'handle',
95
+      key: 'handle',
96
+      align: 'center',
97
+      render: (x,row) => (
98
+        <>
99
+          <AuthButton name="admin.propaganda.publish" noRight={null}>
100
+            <span style={{ color: '#1990FF', marginRight: '20px',cursor: 'pointer' }} onClick={changeStatus(row)}>{ row.status === 1 ? '下架' : '上架' }<Icon type="vertical-align-top" className={styles.edit} /></span>
101
+          </AuthButton>
102
+          <AuthButton name="admin.propaganda.put" noRight={null}>
103
+            <span style={{ color: '#FF925C', marginRight: '20px', cursor: 'pointer' }} onClick={toEdit(row.contentId)}>编辑<Icon type="form" className={styles.edit} /></span>
104
+          </AuthButton>
105
+          <AuthButton name="admin.propaganda.delete" noRight={null}>
106
+            <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={deleteCarouse(row.contentId)}>删除<Icon type="vertical-align-top" className={styles.edit} /></span>
107
+          </AuthButton>
108
+        </>
109
+      )
110
+    },
111
+  ];
112
+  
113
+  const finishDynamic = (row) => {
114
+      Modal.confirm({
115
+          title: '结束以后将无法编辑, 是否继续?',
116
+          okText: '确定',
117
+          cancelText: '取消',
118
+          onOk() {
119
+              request({ ...apis.carsuseFigure.finish, data: {dynamicId: row.dynamicId, top: ""},}).then((data) => {
120
+                  console.log(data)
121
+                  message.info('操作成功!')
122
+                  getList({ pageNum: 1, pageSize: 10, showType: 'propaganda' })
123
+              }).catch((err) => {
124
+                  console.log(err)
125
+                  message.info(err.msg || err.message)
126
+              })
127
+          },
128
+        });
129
+  }
130
+  
131
+  //删除
132
+const deleteCarouse = (contentId) => () =>{
133
+  Modal.confirm({
134
+    title: '确认删除此数据?',
135
+    okText: '确定',
136
+    cancelText: '取消',
137
+    onOk() {
138
+      request({ ...apis.carsuseFigure.deleteExtendContent,urlData:{id: contentId}}).then((data) => {
139
+            message.info('操作成功!')
140
+            getList({ pageNum: 1, pageSize: 10, showType: 'propaganda' })
141
+        }).catch((err) => {
142
+            console.log(err)
143
+            message.info(err.msg || err.message)
144
+        })
145
+    },
146
+  });
147
+}
148
+
149
+//   停用启用
150
+  const changeStatus = (row) => () => {
151
+      console.log(row)
152
+      if(row.status === 0) {
153
+        
154
+        Modal.confirm({
155
+          title: '确认发布此数据?',
156
+          okText: '确定',
157
+          cancelText: '取消',
158
+          onOk() {
159
+            row.status = 1
160
+              request({ ...apis.carsuseFigure.updataExtendContent,urlData:{id: row.contentId}, data: row,}).then((data) => {
161
+                  message.info('操作成功!')
162
+                  getList({ pageNum: 1, pageSize: 10, showType: 'propaganda' })
163
+              }).catch((err) => {
164
+                  console.log(err)
165
+                  message.info(err.msg || err.message)
166
+              })
167
+          },
168
+        });
169
+      }else if(row.status === 1){
170
+        
171
+        Modal.confirm({
172
+          title: '停用后不会再显示在小程序端',
173
+          okText: '确定',
174
+          cancelText: '取消',
175
+          onOk() {
176
+            row.status = 0
177
+              request({ ...apis.carsuseFigure.updataExtendContent,urlData:{id: row.contentId}, data: row,}).then((data) => {
178
+                  message.info('操作成功!')
179
+                  getList({ pageNum: 1, pageSize: 10, showType: 'propaganda' })
180
+              }).catch((err) => {
181
+                  console.log(err)
182
+                  message.info(err.msg || err.message)
183
+              })
184
+          },
185
+        });
186
+      }
187
+
188
+  }
189
+  
190
+  const changePageNum = (pageNumber, props) => {
191
+    props.form.validateFields((err, values) => {
192
+      if (!err) {
193
+        getList({ pageNum: pageNumber, pageSize: 10, ...values, showType: 'propaganda' })
194
+      }
195
+    });
196
+  }
197
+
198
+  // 提交事件
199
+const handleSubmit = (e, props) => {
200
+    e.preventDefault();
201
+    props.form.validateFields((err, values) => {
202
+      if (!err) {
203
+        console.log('提交数据: ', values)
204
+        getList({ pageNum: 1, pageSize: 10, ...values, showType: 'propaganda' })
205
+      }
206
+    });
207
+  }
208
+
209
+   //重置搜索
210
+   function handleReset() {
211
+    props.form.resetFields();
212
+  }
213
+
214
+
215
+  const { getFieldDecorator } = props.form
216
+  return (
217
+
218
+    <>
219
+      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
220
+      <Form.Item>
221
+          {getFieldDecorator('cityId')(
222
+             <SelectCity />,
223
+          )}
224
+        </Form.Item>
225
+        <Form.Item>
226
+          {getFieldDecorator('buildingId')(
227
+            <BuildSelect />,
228
+          )}
229
+        </Form.Item>
230
+        <Form.Item>
231
+          {getFieldDecorator('contentType')(
232
+            <Select style={{ width: '180px' }} placeholder="类型">
233
+              <Option value="activity">活动</Option>
234
+              <Option value="project">项目</Option>
235
+              <Option value="news">资讯</Option>
236
+              <Option value="help">助力</Option>
237
+              <Option value="group">拼团</Option>
238
+              <Option value="h5">H5</Option>
239
+              <Option value="nothing">无</Option>
240
+            </Select>,
241
+          )}
242
+        </Form.Item>
243
+        {/* <Form.Item>
244
+          {getFieldDecorator('showPosition')(
245
+            <Select style={{ width: '180px' }} placeholder="发布位置">
246
+              <Option value="mall">商城</Option>
247
+              <Option value="index">首页</Option>
248
+            </Select>,
249
+          )}
250
+        </Form.Item> */}
251
+        <Form.Item>
252
+          {getFieldDecorator('status')(
253
+            <Select style={{ width: '180px' }} placeholder="状态">
254
+              <Option value="1">已上架</Option>
255
+              <Option value="0">已下架</Option>
256
+            </Select>,
257
+          )}
258
+        </Form.Item>
259
+        <Form.Item>
260
+        <AuthButton name="admin.advert.search" noRight={null}>
261
+          <Button type="primary" htmlType="submit" className={styles.searchBtn}>
262
+            搜索
263
+          </Button>
264
+          </AuthButton>
265
+          <Button style={{ marginLeft: 8 }} onClick={handleReset}>
266
+              重置
267
+            </Button>
268
+        </Form.Item>
269
+      </Form>
270
+      <AuthButton name="admin.propaganda.post" noRight={null}>
271
+        <Button type="danger" className={styles.addBtn} onClick={toEdit()}>新增</Button>
272
+      </AuthButton>
273
+      <Table dataSource={data.records} columns={columns} pagination={false} rowKey="advertisingList"/>
274
+      <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
275
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={e => changePageNum(e,props)} current={data.current}/>
276
+      </div>
277
+    </>
278
+  )
279
+}
280
+const WrappedHeader = Form.create({ name: 'header' })(header);
281
+
282
+export default WrappedHeader

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

@@ -161,8 +161,11 @@ const header = props => {
161 161
 
162 162
   // 分页
163 163
   function onChange(pageNumber) {
164
-    // eslint-disable-next-line react-hooks/rules-of-hooks
165
-    getList({ pageNum: pageNumber, pageSize: 9 })
164
+    props.form.validateFields((err, values) => {
165
+      if (!err) {
166
+        getList({ pageNum: pageNumber, pageSize: 10, ...values })
167
+      }
168
+    });
166 169
   }
167 170
 
168 171
   return (
@@ -179,7 +182,9 @@ const header = props => {
179 182
           </Select>
180 183
         </div>
181 184
         <div >
185
+        <AuthButton name="admin.channel.search" noRight={null}>
182 186
           <Button type="primary" onClick={() => queryList()}>查询</Button>
187
+          </AuthButton>
183 188
           {/* <Button onClick={() => reset() }>重置</Button> */}
184 189
         </div>
185 190
       </div>

src/pages/customer/independentList/index.jsx → src/pages/channel/independentList/index.jsx Прегледај датотеку

@@ -71,7 +71,11 @@ class ModalTable extends React.Component {
71 71
 
72 72
   // 分页
73 73
   onChange (pageNum) {
74
-    this.getList({ pageNumber: pageNum, pageSize: 5 })
74
+    props.form.validateFields((err, values) => {
75
+      if (!err) {
76
+        getList({ pageNumber: pageNum, pageSize: 5, ...values })
77
+      }
78
+    });
75 79
   }
76 80
 
77 81
   render () {
@@ -437,17 +441,21 @@ function body (props) {
437 441
           )}
438 442
         </Form.Item>
439 443
         <Form.Item style={{ position: 'absolute', right: '38px' }} >
440
-          <Button type="primary" htmlType="submit" >
441
-            搜索
442
-          </Button>
444
+          <AuthButton name="admin.major.search" noRight={null}>
445
+            <Button type="primary" htmlType="submit" >
446
+              搜索
447
+            </Button>
448
+          </AuthButton>
443 449
           <Button style={{ marginLeft: 8 }} onClick={handleReset}>
444 450
             重置
445 451
           </Button>
446 452
         </Form.Item>
447 453
       </Form>
448
-      <Button type="primary" onClick={() => exportIndependen()} style={{ float: 'right', margin: '20px 0', zIndex: 1 }}>
449
-        导出
450
-      </Button>
454
+      <AuthButton name="admin.major.import" noRight={null}>
455
+        <Button type="primary" onClick={() => exportIndependen()} style={{ float: 'right', margin: '20px 0', zIndex: 1 }}>
456
+          导出
457
+        </Button>
458
+      </AuthButton>
451 459
       <Table rowKey="independentIndex" dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />
452 460
       {/* 推荐客户 */}
453 461
       <ModalTable visibleData={gVisibleData} />

src/pages/customer/independentList/style.css → src/pages/channel/independentList/style.css Прегледај датотеку


src/pages/customer/independentList/style.less → src/pages/channel/independentList/style.less Прегледај датотеку


src/pages/customer/independentList/style.wxss → src/pages/channel/independentList/style.wxss Прегледај датотеку


+ 7
- 2
src/pages/customer/customerlist/components/integralRecord.jsx Прегледај датотеку

@@ -86,6 +86,10 @@ class ModalIntegralRecord extends React.Component {
86 86
         return '分享'
87 87
       case 'signup-agent':
88 88
         return '授权手机号'
89
+      case 'activity_checkin':
90
+        return '活动签到'
91
+      case 'document_verify':
92
+          return '资料审核'  
89 93
       case 'recommend-customer':
90 94
         return '推荐客户'
91 95
         case 'group':
@@ -113,7 +117,8 @@ class ModalIntegralRecord extends React.Component {
113 117
         title: '序号',
114 118
         dataIndex: 'index',
115 119
         key: 'index',
116
-        render: (text, record, index) => <span>{(this.state.dataSource.result.total - this.state.dataSource.result.records.length) * 1 + index + 1}</span>,
120
+        render: (text, record, index) => <span>{index + 1}</span>,
121
+        // render: (text, record, index) => <span>{(this.state.dataSource.result.total - this.state.dataSource.result.records.length) * 1 + index + 1}</span>,
117 122
       },
118 123
       {
119 124
         title: '积分类型',
@@ -145,7 +150,7 @@ class ModalIntegralRecord extends React.Component {
145 150
             // onOk={() => this.handleOk()}
146 151
             onCancel={e => this.handleCancel(e)}
147 152
           >
148
-            <Table dataSource={this.state.dataSource.result.records} columns={columns} pagination={{ total: this.state.dataSource.result.total, onChange: e => this.onChange(e) }} />
153
+            <Table dataSource={this.state.dataSource.result.records} columns={columns} pagination={{pageSize: 5, total: this.state.dataSource.result.total, onChange: e => this.onChange(e) }} />
149 154
           </Modal>
150 155
       </>
151 156
     );

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

@@ -1,5 +1,5 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Table, Pagination } from 'antd';
2
+import { Form, Table, Pagination, Button } 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';
@@ -15,8 +15,8 @@ function header(props) {
15 15
    * @returns
16 16
    */
17 17
   // eslint-disable-next-line react-hooks/rules-of-hooks
18
-  const [data, setData] = useState([{ }])
19
-  const [tableData, setTableDataData] = useState([{ }])
18
+  const [data, setData] = useState([{}])
19
+  const [tableData, setTableDataData] = useState([{}])
20 20
   const [dataConsultant, setDataonsultant] = useState({})
21 21
   const [intentionData, setIntentionData] = useState([])
22 22
 
@@ -39,8 +39,8 @@ function header(props) {
39 39
         }]),
40 40
       )
41 41
       arr.push(a)
42
-   }
43
-   setIntentionData(arr)
42
+    }
43
+    setIntentionData(arr)
44 44
   }
45 45
 
46 46
   // 查询
@@ -59,11 +59,11 @@ function header(props) {
59 59
       setIntentionData(res.intentions)
60 60
     })
61 61
   }
62
-// 分页
63
-function onChange(number) {
64
-  if (id === '' || id === undefined) {
65
-    return
66
-  }
62
+  // 分页
63
+  function onChange(number) {
64
+    if (id === '' || id === undefined) {
65
+      return
66
+    }
67 67
     // eslint-disable-next-line max-len
68 68
     request({ ...apis.customer.CustomerRecommendGet, urlData: { id }, params: { pageNumber: number, pageSize: 10 } }).then(res => {
69 69
       setData(res)
@@ -78,19 +78,25 @@ function onChange(number) {
78 78
       key: 'activity',
79 79
       align: 'center',
80 80
     },
81
+    {
82
+      title: '访问内容',
83
+      dataIndex: 'activityName',
84
+      key: 'activityName',
85
+      align: 'center',
86
+    },
81 87
     {
82 88
       title: '访问时间',
83 89
       dataIndex: 'visitTime',
84 90
       key: 'visitTime',
85 91
       align: 'center',
86
-      render: (_, record) => <span> {moment(record.visitTime).format('YYYY-MM-DD HH:mm:ss') }</span>,
92
+      render: (_, record) => <span> {moment(record.visitTime).format('YYYY-MM-DD HH:mm:ss')}</span>,
87 93
     },
88 94
     {
89 95
       title: '停留时间',
90 96
       dataIndex: 'visitDuration',
91 97
       key: 'visitDuration',
92 98
       align: 'center',
93
-      render: (_, record) => <span>{record.visitDuration === null ? 0 : record.visitDuration }秒</span>,
99
+      render: (_, record) => <span>{record.visitDuration === null ? 0 : record.visitDuration}秒</span>,
94 100
     },
95 101
   ]
96 102
   // 意向
@@ -99,7 +105,7 @@ function onChange(number) {
99 105
       title: <span styles={{ color: '#222', fontSize: '24px' }}>项目名称</span>,
100 106
       dataIndex: 'name',
101 107
       width: '64%',
102
-    render: (_, record) => <span>{record.buildingName}</span>,
108
+      render: (_, record) => <span>{record.buildingName}</span>,
103 109
     },
104 110
     {
105 111
       title: <span styles={{ color: '#222', fontSize: '24px' }}>意向值</span>,
@@ -109,61 +115,64 @@ function onChange(number) {
109 115
   ];
110 116
   return (
111 117
     <>
118
+      <Button type="danger" style={{ marginBottom: '18px' }} onClick={() => router.go(-1)}>返回</Button>
112 119
       <div className={styles.cardBox}>
113 120
         <div className={styles.rightBox}>
114 121
           <p className={styles.tit}>客户信息</p>
115
-          <img className={styles.touxiang} src={ data.picture && data.picture } />
116
-          <div className={styles.right}>
117
-            <p className={styles.rightItem}>用户名称:{ data.name }</p>
118
-            <p className={styles.rightItem}>手机号码:{ data.phone }</p>
119
-            <p className={styles.rightItem}>首次访问时间:{data.visitTime && moment(data.visitTime).format('YYYY-MM-DD')}</p>
120
-          </div>
121
-          <div className={styles.Centered}>
122
-          <p>访问时长:{ data.duration }秒</p>
123
-          <p>访问次数:{ data.visitTimes }</p>
124
-          <p className={styles.rightItem}>客户描述:{ data.describe }</p>
125
-          {/* <p>预约人数:{ data.visiteNum }</p> */}
126
-          </div>
127
-          <div className={styles.rightCentered}>
128
-          <p >需求类型:{ data.demandType }</p>
129
-          <p >价格区间:{data.priceRange }</p>
130
-          <p >物业类型:{ data.realtyManageType }</p>
131
-          {/* <p>预约人数:{ data.visiteNum }</p> */}
132
-          </div>
133
-          {/* <p className={styles.rightItem}>预约到访时间:{data.appointmentTime && moment(data.appointmentTime).format('YYYY-MM-DD') }</p> */}
134
-          <div className={styles.rightInfo}>
135
-            <p className={styles.rightItem}>国家:{ dataConsultant && dataConsultant.country }</p>
136
-            <p className={styles.rightItem}>省份:{ dataConsultant && dataConsultant.provience }</p>
137
-            <p className={styles.rightItem}>城市:{dataConsultant && dataConsultant.city }</p>
138
-            <p className={styles.rightItem}>来访渠道:活动分享</p>
139
-            {/* <p className={styles.rightItem}>详细信息:</p> */}
140
-            {/* <p className={styles.rightItem}>意向项目:{data.intention }</p> */} 
141
-            {/* <p className={styles.rightItem}>客户说明:{ data.verifyRemark }</p> */}
122
+          <div className={styles.flexBox}>
123
+            <img className={styles.touxiang} src={data.picture && data.picture} />
124
+            <div className={styles.right}>
125
+              <p className={styles.rightItem}>用户名称:{data.name}</p>
126
+              <p className={styles.rightItem}>手机号码:{data.phone}</p>
127
+              <p className={styles.rightItem}>首次访问时间:{data.visitTime && moment(data.visitTime).format('YYYY-MM-DD')}</p>
128
+            </div>
129
+            <div className={styles.Centered}>
130
+              <p>访问时长:{data.duration}秒</p>
131
+              <p>访问次数:{data.visitTimes}次</p>
132
+              <p className={styles.rightItem}>客户描述:{data.describe}</p>
133
+              {/* <p>预约人数:{ data.visiteNum }</p> */}
134
+            </div>
135
+            <div className={styles.rightCentered}>
136
+              <p >需求类型:{data.demandType}</p>
137
+              <p >价格区间:{data.priceRange}</p>
138
+              <p >物业类型:{data.realtyManageType}</p>
139
+              {/* <p>预约人数:{ data.visiteNum }</p> */}
140
+            </div>
141
+            {/* <p className={styles.rightItem}>预约到访时间:{data.appointmentTime && moment(data.appointmentTime).format('YYYY-MM-DD') }</p> */}
142
+            <div className={styles.rightInfo}>
143
+              <p className={styles.rightItem}>国家:{dataConsultant && dataConsultant.country}</p>
144
+              <p className={styles.rightItem}>省份:{dataConsultant && dataConsultant.provience}</p>
145
+              <p className={styles.rightItem}>城市:{dataConsultant && dataConsultant.city}</p>
146
+              <p className={styles.rightItem}>来访渠道:{data.personFrom}</p>
147
+              {/* <p className={styles.rightItem}>详细信息:</p> */}
148
+              {/* <p className={styles.rightItem}>意向项目:{data.intention }</p> */}
149
+              {/* <p className={styles.rightItem}>客户说明:{ data.verifyRemark }</p> */}
150
+            </div>
142 151
           </div>
143 152
         </div>
144 153
       </div>
145 154
       <br></br>
146 155
       <div className={styles.cardBox}>
147
-          <div className={styles.rightBoxCentre}>
156
+        <div className={styles.rightBoxCentre}>
148 157
           <p className={styles.tit}>置业顾问信息</p>
149 158
           <div>
150
-          <img className={styles.touxiangphoto}  src={ data.consultant && data.consultant.photo }/>
151
-          <p >{data.consultant && data.consultant.userName}</p>
159
+            <img className={styles.touxiangphoto} src={data.consultant && data.consultant.photo} />
160
+            <p >{data.consultant && data.consultant.userName}</p>
152 161
           </div>
153
-          <div className={styles.right}>
154
-          {/* <p className={styles.infoItem}>姓名:{ data.consultant && data.consultant.name }</p>
162
+          <div className={styles.rightphone}>
163
+            {/* <p className={styles.infoItem}>姓名:{ data.consultant && data.consultant.name }</p>
155 164
           <p className={styles.infoItem}>部门:{ data.consultant && data.consultant.department }</p> */}
156
-          <p className={styles.infoItem}>号码:{ data.consultant && data.consultant.phone } </p>
157
-          <p className={styles.infoItem}>岗位:{ data.consultant && data.consultant.position }</p>
165
+            <p className={styles.infoItem}>号码:{data.consultant && data.consultant.phone} </p>
166
+            <p className={styles.infoItem}>岗位:{data.consultant && data.consultant.position}</p>
158 167
           </div>
159 168
           <div className={styles.left}>
160
-          <p className={styles.infoItem}>公司:{ data.consultant && data.consultant.orgName } </p>
161
-          <p className={styles.infoItem}>
162
-            所属项目:
169
+            <p className={styles.infoItem}>公司:{data.consultant && data.consultant.orgName} </p>
170
+            <p className={styles.infoItem}>
171
+              所属项目:
163 172
             {
164
-              data.consultant && data.consultant.projects.map((item, _) => <span>{item}</span>)
165
-            }
166
-          </p>
173
+                data.consultant && data.consultant.projects.map((item, _) => <span>{item}</span>)
174
+              }
175
+            </p>
167 176
           </div>
168 177
         </div>
169 178
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
@@ -174,7 +183,7 @@ function onChange(number) {
174 183
           </div> */}
175 184
           {/* <img className={styles.touxiang} src={ data.picture && data.picture } /> */}
176 185
           {/* <div className={styles.infoItem}> */}
177
-          <Table bordered = { false } columnWidth={10} columns={intention} dataSource={intentionData} pagination={false} scroll={intentionData && intentionData.length >= 3 ? { y: 240 } : false} width={500}/>
186
+          <Table bordered={false} columnWidth={10} columns={intention} dataSource={intentionData} pagination={false} scroll={intentionData && intentionData.length >= 3 ? { y: 240 } : false} width={500} />
178 187
           {/* </div> */}
179 188
         </div>
180 189
 

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

@@ -105,7 +105,11 @@ function body(props) {
105 105
   // 分页
106 106
   function onChange(pageNum) {
107 107
     // eslint-disable-next-line react-hooks/rules-of-hooks
108
-    getList({ pageNumber: pageNum, pageSize: 10, customerType })
108
+    props.form.validateFields((err, values) => {
109
+      if (!err) {
110
+        getList({ pageNumber: pageNum, pageSize: 10, customerType, ...values })
111
+      }
112
+    });
109 113
   }
110 114
 
111 115
   // 私客/公客切换
@@ -217,7 +221,7 @@ function body(props) {
217 221
       key: 'picture',
218 222
       align: 'center',
219 223
       width: '15%',
220
-      render: (_, record) => <Avatar shape="square" src={customerType === 'private' ? record.picture : record.avatarurl} size={64} icon="user" />,
224
+      render: (_, record) => <Avatar shape="square" style={{color: 'blue',cursor: 'pointer'}} onClick={() => publicCustomerDetail(record)} src={customerType === 'private' ? record.picture : record.avatarurl} size={64} icon="user" />,
221 225
     },
222 226
     {
223 227
       title: '姓名',
@@ -226,7 +230,7 @@ function body(props) {
226 230
       align: 'center',
227 231
       width: '10%',
228 232
       // eslint-disable-next-line no-nested-ternary
229
-      render: (_, record) => <><span>{customerType === 'private' ? record.name : record.nickname}</span></>,
233
+      render: (_, record) => <><span style={{color: 'blue',cursor: 'pointer'}} onClick={() => publicCustomerDetail(record)} >{customerType === 'private' ? record.name : record.nickname}</span></>,
230 234
     },
231 235
     {
232 236
       title: '电话',
@@ -249,7 +253,7 @@ function body(props) {
249 253
       align: 'center',
250 254
       width: '10%',
251 255
       // eslint-disable-next-line no-nested-ternary
252
-      render: (_, record) => <><span>{record.gender === 1 ? '男' : record.gender === 2 ? '女' : '未知'}</span></>,
256
+      render: (_, record) => <><span>{record.gender === '1' ? '男' : record.gender === '2' ? '女' : '未知'}</span></>,
253 257
     },
254 258
     {
255 259
       title: '操作',
@@ -260,11 +264,11 @@ function body(props) {
260 264
       // eslint-disable-next-line no-nested-ternary
261 265
       render: (_, record) => (
262 266
         <>
263
-          <AuthButton>
267
+          <AuthButton name="admin.customer.public.detail" noRight={null}>
264 268
             <Button className={customerType === 'private' ? Styles.displayS : Styles.text } type="link" onClick={() => publicCustomerDetail(record)}>查看详情</Button>
265 269
           </AuthButton>
266 270
           &nbsp;&nbsp;
267
-          <AuthButton>
271
+          <AuthButton name="admin.customer.recommend" noRight={null}>
268 272
             <Button className={customerType === 'private' ? Styles.displayS : Styles.text } type="link" onClick={() => showRecommend(record.personId)}>推荐客户</Button>
269 273
           </AuthButton>
270 274
         </>
@@ -279,7 +283,7 @@ function body(props) {
279 283
       key: 'picture',
280 284
       align: 'center',
281 285
       width: '15%',
282
-      render: (_, record) => <Avatar shape="square" src={customerType === 'private' ? record.picture : record.avatarurl} size={64} icon="user" />,
286
+      render: (_, record) => <Avatar shape="square" style={{color: 'blue',cursor: 'pointer'}} onClick={() => toCustomerDateil(record)} src={customerType === 'private' ? record.picture : record.avatarurl} size={64} icon="user" />,
283 287
     },
284 288
     {
285 289
       title: '姓名',
@@ -288,7 +292,7 @@ function body(props) {
288 292
       align: 'center',
289 293
       width: '10%',
290 294
       // eslint-disable-next-line no-nested-ternary
291
-      render: (_, record) => <><span>{customerType === 'private' ? record.name : record.nickname}</span></>,
295
+      render: (_, record) => <><span style={{color: 'blue',cursor: 'pointer'}} onClick={() => toCustomerDateil(record)}>{customerType === 'private' ? record.name : record.nickname}</span></>,
292 296
     },
293 297
     {
294 298
       title: '电话',
@@ -354,7 +358,9 @@ function body(props) {
354 358
             &nbsp;
355 359
           <AuthButton name="admin.customer.recommend.edit.id.put" noRight={null}>
356 360
             <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showStatus(record)}>变更状态</Button>
361
+            </AuthButton>
357 362
             &nbsp;&nbsp;
363
+          <AuthButton name="admin.customer.recommend.belong" noRight={null}>
358 364
             <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showGM(record)}>调整归属</Button>
359 365
           </AuthButton>
360 366
             &nbsp;&nbsp;
@@ -362,7 +368,7 @@ function body(props) {
362 368
             <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => toCustomerDateil(record)}>查看详情</Button>
363 369
           </AuthButton>
364 370
             &nbsp;&nbsp;
365
-          <AuthButton name="admin.mine.taPointsRecords.id.get" noRight={null}>
371
+          <AuthButton name="admin.mine.taPointsRecords.point.record" noRight={null}>
366 372
             <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showRecord(record)}>积分记录</Button>
367 373
           </AuthButton>
368 374
             &nbsp;
@@ -420,29 +426,43 @@ function body(props) {
420 426
           )}
421 427
         </Form.Item>}
422 428
         <Form.Item>
423
-            <Button type="primary" htmlType="submit" >
424
-              查询
425
-            </Button>
429
+            <AuthButton name="admin.customer.recommend.search" noRight={null}>
430
+              <Button type="primary" htmlType="submit" >
431
+                查询
432
+              </Button>
433
+            </AuthButton>
426 434
             <Button style={{ marginLeft: 8 }} onClick={handleReset}>
427 435
               重置
428 436
             </Button>
429 437
         </Form.Item>
430 438
       </Form>
431
-      <Button type="primary" onClick={() => exportCustomer()} style={{ float: 'right', margin: '20px 0', zIndex: 1 }}>
432
-        导出
433
-      </Button>
439
+      <AuthButton name="admin.customer.import" noRight={null}>
440
+        <Button type="primary" onClick={() => exportCustomer()} style={{ float: 'right', margin: '20px 0', zIndex: 1 }}>
441
+          导出
442
+        </Button>
443
+      </AuthButton>
434 444
 
435 445
       <div style={{ margin: '20px 0'}}>
436
-        <AuthButton name="admin.customer.recommend.get" noRight={null}>
437 446
           <Radio.Group value={customerType} onChange={radioButtonHandleSizeChange} buttonStyle="solid">
438 447
             <Radio.Button value="private">私客</Radio.Button>
439 448
             <Radio.Button value="public">公客</Radio.Button>
440 449
           </Radio.Group>
441
-        </AuthButton>
442 450
       </div>
443 451
       {customerType === 'private' ? 
444
-        <Table dataSource={dataSource.records} columns={privateColumns} pagination={{ total: dataSource.total, onChange }} rowKey="customerList" /> :
445
-        <Table dataSource={dataSource.records} columns={publicColumns} pagination={{ total: dataSource.total, onChange }} rowKey="customerList" /> 
452
+        <Table 
453
+        // onRow={record => {
454
+        //   return {
455
+        //     onClick: () => toCustomerDateil(record),
456
+        //   };
457
+        // }}
458
+        dataSource={dataSource.records} columns={privateColumns} pagination={{ total: dataSource.total, onChange }} rowKey="customerList" /> :
459
+        <Table 
460
+        // onRow={record => {
461
+        //   return {
462
+        //     onClick: () => publicCustomerDetail(record),
463
+        //   };
464
+        // }}
465
+        dataSource={dataSource.records} columns={publicColumns} pagination={{ total: dataSource.total, onChange }} rowKey="customerList" /> 
446 466
       }
447 467
       
448 468
       {/* 调整归属 */}

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

@@ -1,5 +1,5 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Table, Pagination } from 'antd';
2
+import { Form, Table, Pagination,Button } from 'antd';
3 3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4 4
 import publicStyle from './publicStyle.less';
5 5
 import apis from '../../../services/apis';
@@ -79,6 +79,12 @@ function onChange(number) {
79 79
       key: 'activity',
80 80
       align: 'center',
81 81
     },
82
+    {
83
+      title: '访问内容',
84
+      dataIndex: 'activityName',
85
+      key: 'activityName',
86
+      align: 'center',
87
+    },
82 88
     {
83 89
       title: '访问时间',
84 90
       dataIndex: 'visitTime',
@@ -111,6 +117,7 @@ function onChange(number) {
111 117
 
112 118
   return (
113 119
     <>
120
+    <Button type="danger" onClick={() => router.go(-1)} style={{ marginBottom: '18px' }}>返回</Button>
114 121
       <div className={publicStyle.cardBox}>
115 122
      {/* { console.log("data:",data),console.log("data:",dataConsultant)} */}
116 123
         <div className={publicStyle.rightBox}>
@@ -123,8 +130,8 @@ function onChange(number) {
123 130
           </div>
124 131
           <div className={publicStyle.Centered}>
125 132
           <p>访问时长:{ data.duration }秒</p>
126
-          <p>访问次数:{ data.visitTimes }</p>
127
-          <p className={publicStyle.rightItem}>来访渠道:活动分享</p>
133
+          <p>访问次数:{ data.visitTimes }</p>
134
+          <p className={publicStyle.rightItem}>来访渠道:{data.personFrom}</p>
128 135
           {/* <p>预约人数:{ data.visiteNum }</p> */}
129 136
           </div>
130 137
           {/* <p className={styles.rightItem}>预约到访时间:{data.appointmentTime && moment(data.appointmentTime).format('YYYY-MM-DD') }</p> */}
@@ -141,7 +148,7 @@ function onChange(number) {
141 148
         <div className={publicStyle.leftBoxCentre}>
142 149
           <div className={publicStyle.tit}>
143 150
                 <span>项目名称</span>
144
-                <span style={{ marginLeft: '47%' }}>意向值</span>
151
+                <span style={{ float: 'right' }}>意向值</span>
145 152
           </div>
146 153
           {/* <img className={styles.touxiang} src={ data.picture && data.picture } /> */}
147 154
           <div className={publicStyle.infoItem}>

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

@@ -136,7 +136,7 @@
136 136
     position: relative;
137 137
   }
138 138
   .tit{
139
-    font-size:24px;
139
+    font-size:0.15rem;
140 140
     font-weight:600;
141 141
     color:#222;
142 142
     margin: 10px 0 0 0;
@@ -149,13 +149,13 @@
149 149
   }
150 150
   .infoItem{
151 151
     color:#666;
152
-    font-size: 19px;
152
+    font-size: 0.1rem;
153 153
     margin: 0 0 10px 0;
154 154
     
155 155
   }
156 156
   .rightItem{
157 157
     color:#666;
158
-    font-size: 19px;
158
+    font-size: 0.1rem;
159 159
     margin: 0 0 15px 0;
160 160
   }
161 161
   .right{
@@ -177,10 +177,10 @@
177 177
   .Centered{
178 178
     position: absolute;
179 179
     top:108px;
180
-    left:40%;
180
+    left:50%;
181 181
     margin: 0 0 15px 0;
182 182
     color:#666;
183
-    font-size: 19px;
183
+    font-size: 0.1rem;
184 184
   }
185 185
 
186 186
   .rightCentered{
@@ -189,7 +189,7 @@
189 189
     left:55%;
190 190
     margin: 0 0 15px 0;
191 191
     color:#666;
192
-    font-size: 19px;
192
+    font-size: 0.1rem;
193 193
   }
194 194
   
195 195
 }

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

@@ -136,11 +136,15 @@
136 136
     position: relative;
137 137
   }
138 138
   .tit{
139
-    font-size:24px;
139
+    font-size:0.15rem;
140 140
     font-weight:600;
141 141
     color:#222;
142 142
     margin: 10px 0 0 0;
143 143
   }
144
+  .flexBox{
145
+    display: flex;
146
+    align-items: end;
147
+  }
144 148
   .touxiang{
145 149
     width: 120px;
146 150
     width: 120px;
@@ -154,16 +158,26 @@
154 158
   }
155 159
   .infoItem{
156 160
     color:#666;
157
-    font-size: 19px;
161
+    font-size: 0.1rem;
158 162
     margin: 0 0 30px 0;
159 163
     
160 164
   }
161 165
   .rightItem{
162 166
     color:#666;
163
-    font-size: 19px;
167
+    font-size: 0.1rem;
164 168
     margin: 0 0 15px 0;
165 169
   }
166 170
   .right{
171
+    width: 25%;
172
+    min-width: 1.3rem;
173
+    margin-left: 0.1rem;
174
+    padding-top: 0.3rem;
175
+    // position: absolute;
176
+    // top:108px;
177
+    // left:170px;
178
+  }
179
+  .rightphone{
180
+  
167 181
     position: absolute;
168 182
     top:108px;
169 183
     left:170px;
@@ -172,29 +186,40 @@
172 186
     position: absolute;
173 187
     top:108px;
174 188
     left:60%;
189
+  
175 190
   }
176 191
   .rightInfo{
177
-    position: absolute;
178
-    top:108px;
179
-    left:80%;
192
+    width: 25%;
193
+    min-width: 1.3rem;
194
+    margin-right: 0.1rem;
195
+    padding-top: 0.3rem;
196
+    // position: absolute;
197
+    // top:108px;
198
+    // left:80%;
180 199
   }
181 200
 
182 201
   .Centered{
183
-    position: absolute;
184
-    top:108px;
185
-    left:30%;
202
+    width: 25%;
203
+    // position: absolute;
204
+    // top:108px;
205
+    // left:30%;
206
+    min-width: 1.3rem;
186 207
     margin: 0 0 15px 0;
187 208
     color:#666;
188
-    font-size: 19px;
209
+    font-size: 0.1rem;
210
+    padding-top: 0.3rem;
189 211
   }
190 212
 
191 213
   .rightCentered{
192
-    position: absolute;
193
-    top:108px;
194
-    left:55%;
214
+    // position: absolute;
215
+    // top:108px;
216
+    // left:55%;
217
+    width: 25%;
218
+    min-width: 1.3rem;
195 219
     margin: 0 0 15px 0;
220
+    padding-top: 0.3rem;
196 221
     color:#666;
197
-    font-size: 19px;
222
+    font-size: 0.1rem;
198 223
   }
199 224
   
200 225
 }

+ 6
- 2
src/pages/customer/visiting/index.jsx Прегледај датотеку

@@ -101,7 +101,11 @@ function body (props) {
101 101
 
102 102
   // 分页
103 103
   function onChange(pageNum) {
104
-   
104
+    props.form.validateFields((err, values) => {
105
+      if (!err) {
106
+        getList({ pageNumber: pageNum, pageSize: 5, ...values })
107
+      }
108
+    });
105 109
     // getList({ pageNumber: pageNum, pageSize: 9 })
106 110
   }
107 111
 
@@ -159,7 +163,7 @@ function body (props) {
159 163
         导出
160 164
       </Button>
161 165
 
162
-      <Table dataSource={data} columns={columns} pagination={{ total: 1, onChange }} />
166
+      <Table dataSource={data} columns={columns} pagination={{ total: data.total, onChange }} />
163 167
       {/* pagination={{ total: dataSource.total, onChange }} */}
164 168
     </>
165 169
   );

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

@@ -8,6 +8,7 @@ import apis from '../../../services/apis';
8 8
 
9 9
 const UserBehavior = (props) => {
10 10
   const [data, setData] = useState({ records: [] })
11
+  const [buildingId, setBuildingId] = useState('')
11 12
   useEffect(() => {
12 13
     IntentionUsers()
13 14
     // getUserBehaviorProfile(formatDate(props.startDate, props.endDate))
@@ -78,13 +79,14 @@ const UserBehavior = (props) => {
78 79
 
79 80
   function handleBuildingChange (e) {
80 81
     IntentionUsers({ buildingId: e })
82
+    setBuildingId(e)
81 83
   }
82 84
   return (
83 85
     <>
84 86
       <div>
85 87
       <p style={{fontSize:'0.12rem',fontWeight:'600'}}>意向客户</p>
86 88
 
87
-        <BuildSelect slot='action' onChange={(e => handleBuildingChange(e))}></BuildSelect>
89
+        <BuildSelect slot='action' onChange={(e => handleBuildingChange(e))} value={buildingId}></BuildSelect>
88 90
 
89 91
         <Table rowKey="IntentionalCustomers" dataSource={data.records} columns={columns} style={{marginTop:'15px'}} pagination={false} scroll={{ y: 500 }} />
90 92
 

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

@@ -107,6 +107,7 @@ const formatDate = (start, end) => {
107 107
 const UserBehavior = props => {
108 108
   const [data, setData] = useState({ records: [] })
109 109
   const [visibleData, setVisibleData] = useState({ visible: false, row: {} })
110
+  const [buildingId, setBuildingId] = useState('')
110 111
 
111 112
   // 柱图
112 113
   useEffect(() => {
@@ -190,6 +191,7 @@ const UserBehavior = props => {
190 191
       eventType: props.eventType,
191 192
       buildingId: e,
192 193
     })
194
+    setBuildingId(e)
193 195
   }
194 196
 
195 197
   function showDetails(row) {
@@ -272,7 +274,7 @@ const UserBehavior = props => {
272 274
           {!props.BuildSelectHide && <span style={{ fontSize: '0.09rem', color: '#888', marginLeft: '0.06rem' }}>最近七天</span>}
273 275
         </p>
274 276
         <div style={{ float: 'right', marginTop: '-40px', marginBottom: '20px' }}>
275
-          {!props.BuildSelectHide && <BuildSelect slot="action" onChange={(e => handleBuildingChange(e))}></BuildSelect>}
277
+          {!props.BuildSelectHide && <BuildSelect slot="action" onChange={(e => handleBuildingChange(e))} value={buildingId}></BuildSelect>}
276 278
         </div>
277 279
         <EChart options={options} style={style} />
278 280
         {props.tableShow &&

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

@@ -4,7 +4,7 @@ import { Row, Col, Menu, Dropdown } from 'antd';
4 4
 import NewUsers from './components/NewUsers'
5 5
 // import XForm, { FieldTypes } from '../../components/XForm';
6 6
 import moment from 'moment';
7
-
7
+import router from 'umi/router';
8 8
 import EChart from '../../components/EchartsTest/EChart';
9 9
 import request from '../../utils/request';
10 10
 import apis from '../../services/apis';
@@ -101,6 +101,7 @@ const header = props => {
101 101
       <Button type="primary" htmlType="submit" style={{ marginLeft: '30px' }} onClick={datalist}>
102 102
         搜索
103 103
           </Button>
104
+          <Button type="danger" onClick={() => router.go(-1)} style={{ marginBottom: '18px', marginLeft: '30px' }}>返回</Button>  
104 105
       <div>
105 106
         <NewUsers BuildSelectHide={true} endDate={endDate} startDate={startDate}  dataZoom={true} ></NewUsers>
106 107
         {/* */}

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

@@ -8,6 +8,8 @@ import request from '../../utils/request';
8 8
 import apis from '../../services/apis';
9 9
 import BuildSelect from '../../components/SelectButton/BuildSelect'
10 10
 import { func } from 'prop-types';
11
+import router from 'umi/router';
12
+
11 13
 
12 14
 // const formatDate = (start, end) => {
13 15
 //   const startDate = moment(start).format('YYYY-MM-DDT00:00:00.000') + 'Z'
@@ -182,6 +184,8 @@ const header = props => {
182 184
               重置
183 185
             </Button>
184 186
 
187
+            <Button type="danger" style={{ marginLeft: '18px', float: 'right' }} onClick={() => router.go(-1)}>返回</Button>
188
+
185 189
           <div style={{ display: 'flex', margin: '24px 0' }}>
186 190
             <Form.Item>
187 191
               {getFieldDecorator('buildingId')(

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

@@ -7,7 +7,7 @@ import moment from 'moment';
7 7
 import EChart from '../../components/EchartsTest/EChart';
8 8
 import request from '../../utils/request';
9 9
 import apis from '../../services/apis';
10
-
10
+import router from 'umi/router';
11 11
 
12 12
 
13 13
 const { RangePicker } = DatePicker;
@@ -159,6 +159,7 @@ class Header extends React.Component {
159 159
         <Button type="primary" htmlType="submit" style={{ marginLeft: '30px' }} onClick={() => this.datalist()}>
160 160
           查询
161 161
         </Button>
162
+        <Button type="danger" onClick={() => router.go(-1)} style={{ marginBottom: '18px', marginLeft: '30px' }}>返回</Button>
162 163
         <div>
163 164
   
164 165
           <div style={{ display: 'flex' }}>

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

@@ -38,7 +38,11 @@ function header(props) {
38 38
   }
39 39
 
40 40
   const changePageNum = (pageNumber) => {
41
-    getList({ pageNum: pageNumber, pageSize: 10 })
41
+    props.form.validateFields((err, values) => {
42
+      if (!err) {
43
+        getList({ pageNumber: pageNumber, pageSize: 10, ...values })
44
+      }
45
+    });
42 46
   }
43 47
 
44 48
   function handleReset() {
@@ -191,9 +195,11 @@ function header(props) {
191 195
           )}
192 196
         </Form.Item>
193 197
         <Form.Item>
194
-            <Button type="primary" htmlType="submit" className={styles.searchBtn}>
195
-              搜索
196
-            </Button>
198
+            <AuthButton name="admin.taGoods.search" noRight={null}>
199
+              <Button type="primary" htmlType="submit" className={styles.searchBtn}>
200
+                搜索
201
+              </Button>
202
+            </AuthButton>
197 203
             <Button style={{ marginLeft: 8 }} onClick={handleReset}>
198 204
               重置
199 205
             </Button>

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

@@ -72,7 +72,11 @@ function record(props) {
72 72
   }
73 73
 
74 74
   const changePageNum = (pageNumber) => {
75
-    getList({ pageNum: pageNumber, pageSize: 10 })
75
+    props.form.validateFields((err, values) => {
76
+      if (!err) {
77
+        getList({ pageNum: pageNumber, pageSize: 10, ...values })
78
+      }
79
+    });
76 80
   }
77 81
 
78 82
   const columns = [
@@ -180,9 +184,11 @@ function record(props) {
180 184
           </Form.Item>
181 185
           
182 186
           <Form.Item style={{position:'absolute',right:'38px'}}>
183
-            <Button type="primary" htmlType="submit">
184
-              搜索
185
-            </Button>
187
+            <AuthButton name="admin.taGoods.exchange" noRight={null}>
188
+              <Button type="primary" htmlType="submit">
189
+                搜索
190
+              </Button>
191
+            </AuthButton>
186 192
             <Button style={{ marginLeft: 8 }} onClick={handleReset}>
187 193
               重置
188 194
             </Button>

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

@@ -25,7 +25,7 @@ const header = (props) => {
25 25
   }
26 26
 
27 27
   const changePageNum = (pageNumber) => {
28
-    getVerifyList({ pageNum: 1, pageSize: 10, phone: props.location.query.telValue })
28
+    getVerifyList({ pageNum: pageNumber, pageSize: 10, phone: props.location.query.telValue })
29 29
   }
30 30
 
31 31
   const toBack = () => {
@@ -56,7 +56,7 @@ const header = (props) => {
56 56
       dataIndex: 'personType',
57 57
       key: 'personType',
58 58
       align: 'center',
59
-      render: (personType)=> <><span>{personType === 'Realty Consultant' ? '置业顾问' : personType === 'Sales Executive' ? '销售主管' : personType === 'estate agent' ? '经纪人' : ''}</span></>
59
+      render: (personType)=> <><span>{personType === 'Realty Consultant' ? '置业顾问' : personType === 'Sales Executive' ? '销售主管' : personType === 'estate agent' ? '经纪人' : personType === 'customer' ? '客户' : ''}</span></>
60 60
     },
61 61
     {
62 62
       title: '手机号',

+ 14
- 7
src/pages/news/list/NewsList.jsx Прегледај датотеку

@@ -180,7 +180,7 @@ function body(props) {
180 180
         cover={<img alt="example" src={data.newsImg} style={{ borderRadius: '12px 0 0 12px', width: '230px', height: '228px' }}></img>}
181 181
         bodyStyle={{ padding: '10px 20px' }}
182 182
       >
183
-        <AuthButton name="admin.taNews.id.put" noRight={null}>
183
+        <AuthButton name="admin.taNews.top" noRight={null}>
184 184
         <span style={{ position: 'absolute', right: '83px', top: '16px', fontSize: ' 0.106rem',zIndex:1, color: '#FF7E48', cursor: 'pointer' }} onClick={topNews(data.weight, data.newsId)}>{ data.weight === 1 ? '取消置顶' : '置顶' }</span>
185 185
         </AuthButton>
186 186
 
@@ -189,6 +189,8 @@ function body(props) {
189 189
             编辑
190 190
                   <Icon type="form" style={{ color: '#C0C4CC', marginLeft: '10px' }} />
191 191
           </span>
192
+          </AuthButton>
193
+          <AuthButton name="admin.taNews.publish" noRight={null}>
192 194
           {data.newsStatus === 0 ?
193 195
             <span style={{ position: 'absolute', left: '250px', bottom: ' 10px', fontSize: ' 0.106rem', color: '#FF7E48', zIndex: 1, cursor: 'pointer' }} onClick={cancelRelease.bind(this, data.newsId, 1, data.buildingId, data.newsType.newsTypeId)}>
194 196
               取消发布
@@ -224,7 +226,7 @@ function body(props) {
224 226
           </p>
225 227
 
226 228
           <p style={{ fontSize: ' 0.106rem', color: '#555', marginBottom: '8px', display: 'flex', alignItems: 'center' }}>
227
-            <span style={{ display: 'inline-block', width: '50%', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>点赞数量:{data.favorNum}</span>
229
+            {/* <span style={{ display: 'inline-block', width: '50%', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>点赞数量:{data.favorNum}</span> */}
228 230
             <span>收藏数量:{data.saveNum}</span>
229 231
           </p>
230 232
 
@@ -243,8 +245,11 @@ function body(props) {
243 245
 
244 246
   // 分页
245 247
   function onChange(pageNumber) {
246
-    // eslint-disable-next-line react-hooks/rules-of-hooks
247
-    getList({ pageNum: pageNumber, pageSize: 6 })
248
+    props.form.validateFields((err, values) => {
249
+      if (!err) {
250
+        getList({ pageNum: pageNumber, pageSize: 6, ...values })
251
+      }
252
+    });
248 253
   }
249 254
 
250 255
   //重置搜索
@@ -293,9 +298,11 @@ function body(props) {
293 298
           )}
294 299
         </Form.Item>
295 300
         <Form.Item>
296
-          <Button type="primary" htmlType="submit" >
297
-            搜索
298
-          </Button>
301
+          <AuthButton name="admin.news.search" noRight={null}>
302
+            <Button type="primary" htmlType="submit" >
303
+              搜索
304
+            </Button>
305
+          </AuthButton>
299 306
           <Button style={{ marginLeft: 8 }} onClick={handleReset}>
300 307
             重置
301 308
             </Button>

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

@@ -31,10 +31,12 @@ const { TextArea } = Input;
31 31
   const newsId = props.location.query.newsId
32 32
   const [ dynamicData, setDynamicData ] = useState({})
33 33
   
34
-  if(newsId){
34
+  
35 35
     useEffect(() => {
36
-      getDynamicData(newsId);
37
-    },[])
36
+      if(newsId){
37
+        getDynamicData(newsId);
38
+      }
39
+    },[newsId])
38 40
 
39 41
   // 查询列表
40 42
   const getDynamicData = (newsId) => {
@@ -45,7 +47,6 @@ const { TextArea } = Input;
45 47
       message.info(err.msg || err.message)
46 48
     })
47 49
     }
48
-  }
49 50
 
50 51
   
51 52
 
@@ -77,7 +78,7 @@ const { TextArea } = Input;
77 78
         name: 'newsImg',
78 79
         type: FieldTypes.ImageUploader,
79 80
         value: dynamicData.newsImg,
80
-        help: '建议图片尺寸:320*256px,比例5:4,格式:jpg,用于资讯列表',
81
+        help: '建议图片尺寸:320*240px,比例5:4,格式:jpg,用于资讯列表',
81 82
         rules: [
82 83
           {required: true, message: '请选择资讯列表'},
83 84
         ]
@@ -124,6 +125,12 @@ const { TextArea } = Input;
124 125
         request({ ...apis.news.post, data: { ...submitValue },}).then((data) => {
125 126
           // cancelPage();
126 127
           message.info("保存成功")
128
+          router.push({
129
+            pathname: '/news/list/editNewsList',
130
+            query: {
131
+              newsId:data.newsId
132
+            },
133
+          });
127 134
           console.log(data,'data2')
128 135
         }).catch((err) => {
129 136
           message.info(err.msg || err.message)
@@ -241,7 +248,7 @@ const { TextArea } = Input;
241 248
           </div>
242 249
           <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
243 250
             <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报描述</p>
244
-            <TextArea rows={5} value={textAreaValue} onChange={e => changeTextArea(e.target.value)} />
251
+            <TextArea rows={5} maxLength={1024} value={textAreaValue} onChange={e => changeTextArea(e.target.value)} />
245 252
           </div>
246 253
 
247 254
         </div>
@@ -299,7 +306,7 @@ const { TextArea } = Input;
299 306
         <div>
300 307
           <p style={{ display: 'flex', alignItems: 'center', fontSize: '14px', color: '#999', margin: '0', lineHeight: '0' }}><img src={logo} style={{ width: '22px', marginRight: '10px' }} />知与行互动</p>
301 308
           <p style={{ fontSize: '16px', color: '#222', fontWeight: '600', margin: '0' }}>{inputValue ? inputValue : '置业V客厅 精准获客平台'}</p>
302
-          <img style={{ width: '200px', height: '140px' }} src={imgValue ? imgValue : poster2} alt="" />
309
+          <img style={{ width: '200px', height: '160px' }} src={imgValue ? imgValue : poster2} alt="" />
303 310
         </div>
304 311
       </div>
305 312
       <div style={{ display: 'flex', alignItems: 'center', width: '100%' }}>

+ 60
- 0
src/pages/news/list/style.less Прегледај датотеку

@@ -55,5 +55,65 @@
55 55
     white-space: nowrap;
56 56
     overflow: hidden;
57 57
   }
58
+
59
+  .SubmitButton {
60
+    background: rgba(239,39,58,1);
61
+    border-radius: 7px;
62
+    border: 0px;
63
+  }
64
+  .SelectFrom {
65
+    width: 180px;
66
+    background: #ffffff;
67
+    border-radius: 7px;
68
+    border: 1px solid #dbdbdb;
69
+  }
70
+  .addButton {
71
+    background: #50be00;
72
+    border-radius: 4px;
73
+    border: 0px;
74
+    margin: 10px 0px;
75
+  }
76
+  .cardText {
77
+    color: #333;
78
+    display: flex;
79
+    align-items: center;
80
+    position: relative;
81
+    line-height: 1.5;
82
+    font-size: 0.106rem;
83
+    margin-bottom: 0.08rem;
84
+  
85
+  }
86
+  .cardItem{
87
+    font-size: 0.106rem;
88
+    font-weight: 400;
89
+    color: #666;
90
+    line-height: 24px;
91
+    display: flex;
92
+    align-items: center;  
93
+  }
94
+  .ediText {
95
+    font-size:  0.106rem;
96
+    color: #ff925c;
97
+    line-height: 24px;
98
+    position: absolute;
99
+    right: 0;
100
+  }
101
+  .title{
102
+    display: inline-block;
103
+    width:  0.54rem;
104
+    justify-content: space-between;
105
+    text-align: justify;
106
+    text-align-last:justify
107
+  }
108
+  
109
+  .address { 
110
+    width: 400px;
111
+    height: 24px; 
112
+    text-overflow: ellipsis; 
113
+    white-space: nowrap;
114
+    overflow: hidden;
115
+  }
116
+  
117
+  
58 118
   
59 119
   

+ 11
- 5
src/pages/news/type/NewsType.jsx Прегледај датотеку

@@ -39,7 +39,11 @@ function header(props) {
39 39
   }
40 40
 
41 41
   const changePageNum = (pageNumber) => {
42
-    getList({ pageNum: pageNumber, pageSize: 10 })
42
+    props.form.validateFields((err, values) => {
43
+      if (!err) {
44
+        getList({ pageNum: pageNumber, pageSize: 10, ...values })
45
+      }
46
+    });
43 47
   }
44 48
 
45 49
 
@@ -84,7 +88,7 @@ function header(props) {
84 88
       dataIndex: 'newsTypeImg',
85 89
       key: 'newsTypeImg',
86 90
       align: 'center',
87
-      render: (text, record) => <img src={record.newsTypeImg} className={styles.touxiang} />,
91
+      render: (text, record) => <img src={record.newsTypeImg} style={{ width: '165px',height: '104px' }} className={styles.touxiang} />,
88 92
     },
89 93
     {
90 94
       title: '名称',
@@ -130,9 +134,11 @@ function header(props) {
130 134
           )}
131 135
         </Form.Item>
132 136
         <Form.Item>
133
-            <Button type="primary" htmlType="submit" >
134
-              查询
135
-            </Button>
137
+            <AuthButton name="admin.taNewsType.search" noRight={null}>
138
+              <Button type="primary" htmlType="submit" >
139
+                查询
140
+              </Button>
141
+            </AuthButton>
136 142
             <Button style={{ marginLeft: 8 }} onClick={handleReset}>
137 143
               重置
138 144
             </Button>

src/pages/customer/recommendCustomer/audit.jsx → src/pages/recommend/recommendCustomer/audit.jsx Прегледај датотеку


src/pages/customer/recommendCustomer/components/attribution.jsx → src/pages/recommend/recommendCustomer/components/attribution.jsx Прегледај датотеку


src/pages/customer/recommendCustomer/index.jsx → src/pages/recommend/recommendCustomer/index.jsx Прегледај датотеку

@@ -65,13 +65,16 @@ function body(props) {
65 65
 
66 66
   // 分页
67 67
   function onChange(pageNum) {
68
-    // eslint-disable-next-line react-hooks/rules-of-hooks
69
-      getList({ pageNumber: pageNum, pageSize: 10 })
68
+    props.form.validateFields((err, values) => {
69
+      if (!err) {
70
+        getList({ pageNumber: pageNum, pageSize: 10, ...values })
71
+      }
72
+    });
70 73
   }
71 74
 
72 75
   function toAudit(cuurentId) {
73 76
     router.push({
74
-      pathname: '/customer/recommendCustomer/audit',
77
+      pathname: '/recommend/recommendCustomer/audit',
75 78
       query: {
76 79
         id: cuurentId,
77 80
       },
@@ -221,19 +224,23 @@ function body(props) {
221 224
             <BuildingSelect />,
222 225
           )}
223 226
         </Form.Item>
224
-        <Form.Item style={{ position:'absolute',right:'38px' }}>
225
-            <Button type="primary" htmlType="submit" >
226
-              搜索
227
-            </Button>
227
+        <Form.Item>
228
+            <AuthButton name="admin.recommend.search" noRight={null}>
229
+              <Button type="primary" htmlType="submit" >
230
+                搜索
231
+              </Button>
232
+            </AuthButton>
228 233
             <Button style={{ marginLeft: 8 }} onClick={handleReset}>
229 234
               重置
230 235
             </Button>
231 236
         </Form.Item>
232 237
       </Form>
233 238
       {/* style={{float:'right',margin:'20px 0'}} */}
234
-      <Button type="primary" onClick={() => exportRecommendCustomer()}>
235
-        导出
236
-      </Button>
239
+      <AuthButton name="admin.recommend.import" noRight={null}>
240
+        <Button type="primary" onClick={() => exportRecommendCustomer()}>
241
+          导出
242
+        </Button>
243
+      </AuthButton>
237 244
       <Table rowKey="recommendCustomer" dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />
238 245
     </>
239 246
   );

src/pages/customer/recommendCustomer/style.css → src/pages/recommend/recommendCustomer/style.css Прегледај датотеку


src/pages/customer/recommendCustomer/style.less → src/pages/recommend/recommendCustomer/style.less Прегледај датотеку


src/pages/customer/recommendCustomer/style.wxss → src/pages/recommend/recommendCustomer/style.wxss Прегледај датотеку


+ 187
- 0
src/pages/record/drainage/DrainageVisitRecordList.jsx Прегледај датотеку

@@ -0,0 +1,187 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, DatePicker } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import styles from '../../style/GoodsList.less';
5
+import router from 'umi/router';
6
+import moment from 'moment';
7
+import SelectCity from '../../../components/SelectButton/CitySelect'
8
+import BuildSelect from '../../../components/SelectButton/BuildSelect'
9
+import apis from '../../../services/apis';
10
+import request from '../../../utils/request';
11
+import AuthButton from '@/components/AuthButton';
12
+
13
+const { Option } = Select;
14
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
15
+
16
+const header = props => {
17
+  const [data, setData] = useState({})
18
+  //   const [page, changePage] = useState({})
19
+
20
+  useEffect(() => {
21
+    getList({ pageNum: 1, pageSize: 10 });
22
+  }, [])
23
+
24
+  // 查询列表
25
+  const getList = (params) => {
26
+    console.log(params);
27
+    request({ ...apis.activity.taDrainageVisitRecord, params: { ...params } }).then((data) => {
28
+      console.log(data)
29
+      setData(data)
30
+    })
31
+  }
32
+
33
+  /**
34
+   *
35
+   *
36
+   * @param {*} props
37
+   * @returns
38
+   */
39
+
40
+  const columns = [
41
+    {
42
+      title: '活动名称',
43
+      dataIndex: 'activityName',
44
+      key: 'activityName',
45
+      align: 'center',
46
+      render: (text, record) => <span>{record.activityName != null ? record.activityName : 
47
+        record.drainageName != null ? record.drainageName : record.buildingName != null ? record.buildingName:record.newsName != null ? record.newsName : record.helpActivityName !=null ? record.helpActivityName :
48
+        record.groupActivityName!=null ? record.groupActivityName:''}</span>,
49
+    },
50
+    {
51
+      title: '用户名',
52
+      dataIndex: 'userName',
53
+      key: 'userName',
54
+      align: 'center',
55
+    },
56
+    {
57
+      title: '手机号',
58
+      dataIndex: 'userTel',
59
+      key: 'userTel',
60
+      align: 'center',
61
+    },
62
+    {
63
+      title: '访问时间',
64
+      dataIndex: 'visitTime',
65
+      key: 'visitTime',
66
+      align: 'center',
67
+      render: (x, row) => <><span>{`${moment(row.visitTime).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
68
+    },
69
+    {
70
+      title: '分享者',
71
+      dataIndex: 'shareName',
72
+      key: 'shareName',
73
+      align: 'center',
74
+    },
75
+    {
76
+      title: '分享者手机号',
77
+      dataIndex: 'shareTel',
78
+      key: 'shareTel',
79
+      align: 'center',
80
+    },
81
+    {
82
+      title: '分享者类型',
83
+      dataIndex: 'personType',
84
+      key: 'personType',
85
+      align: 'center',
86
+      render: (text, record) => <span>{record.shareName ? record.consultantId === null || record.consultantId === '' ? '普通客户' : '置业顾问' : ''}</span>,
87
+    },
88
+  ];
89
+  
90
+
91
+  const changePageNum = (pageNumber, props) => {
92
+    getList({ pageNumber: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
93
+  }
94
+
95
+  // 提交事件
96
+  const handleSubmit = (e, props) => {
97
+    e.preventDefault();
98
+    props.form.validateFields((err, values) => {
99
+      if (!err) {
100
+        console.log('提交数据: ', values)
101
+        getList({ pageNum: 1, pageSize: 10, ...values })
102
+      }
103
+    });
104
+  }
105
+
106
+  //重置搜索
107
+  function handleReset () {
108
+    props.form.resetFields();
109
+    getList({ pageNum: 1, pageSize: 10 })
110
+  }
111
+
112
+
113
+  const { getFieldDecorator } = props.form
114
+  return (
115
+
116
+    <>
117
+      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
118
+        <Form.Item>
119
+          {getFieldDecorator('buildingId')(
120
+            <BuildSelect />,
121
+          )}
122
+        </Form.Item>
123
+        <Form.Item>
124
+          {getFieldDecorator('eventType')(
125
+            <Select placeholder="分享类型" style={{ width: 150 }}>
126
+            <Option value="activity">报名活动</Option>
127
+            <Option value="help">助力活动</Option>
128
+            <Option value="group">拼团活动</Option>
129
+            <Option value="h5">H5活动</Option>
130
+            <Option value="building">项目</Option>
131
+            <Option value="news">资讯</Option>
132
+          </Select>
133
+          )}
134
+        </Form.Item>
135
+        <Form.Item>
136
+          {getFieldDecorator('activityName')(
137
+            <Input
138
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
139
+              placeholder="分享标题"
140
+            />,
141
+          )}
142
+        </Form.Item>
143
+        <Form.Item>
144
+          {getFieldDecorator('shareName')(
145
+            <Input
146
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
147
+              placeholder="分享者名称"
148
+            />,
149
+          )}
150
+        </Form.Item>
151
+        <Form.Item>
152
+          {getFieldDecorator('personType')(
153
+             <Select placeholder="分享者类型" style={{ width: 150 }}>
154
+             <Option value="Realty Consultant">置业顾问</Option>
155
+             <Option value="customer">普通客户</Option>
156
+           </Select>
157
+          )}
158
+        </Form.Item>
159
+        <Form.Item>
160
+          {getFieldDecorator('shareTel')(
161
+            <Input
162
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
163
+              placeholder="分享者手机"
164
+            />,
165
+          )}
166
+        </Form.Item>
167
+        <Form.Item>
168
+        <AuthButton name="admin.visit.record.search" noRight={null}>
169
+          <Button type="primary" htmlType="submit" className={styles.searchBtn}> 
170
+            搜索
171
+          </Button>
172
+          </AuthButton>
173
+          <Button style={{ marginLeft: 8 }} onClick={handleReset}>
174
+            重置
175
+            </Button>
176
+        </Form.Item>
177
+      </Form>
178
+      <Table style={{marginTop:'30px'}} dataSource={data.records} columns={columns} pagination={false} rowKey="activityList" />
179
+      <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
180
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={e => changePageNum(e,props)} current={data.current} />
181
+      </div>
182
+    </>
183
+  )
184
+}
185
+const WrappedHeader = Form.create({ name: 'header' })(header);
186
+
187
+export default WrappedHeader

src/pages/customer/report/index.jsx → src/pages/record/report/index.jsx Прегледај датотеку

@@ -67,7 +67,11 @@ function body(props) {
67 67
   // 分页
68 68
   function onChange(pageNum) {
69 69
     // eslint-disable-next-line react-hooks/rules-of-hooks
70
-    getList({ pageNumber: pageNum, pageSize: 9 })
70
+    props.form.validateFields((err, values) => {
71
+      if (!err) {
72
+        getList({ pageNumber: pageNum, pageSize: 10, ...values })
73
+      }
74
+    });
71 75
   }
72 76
 
73 77
   /**
@@ -174,7 +178,7 @@ function body(props) {
174 178
               {getFieldDecorator('sex')(
175 179
                 <Select style={{ width: '180px' }} placeholder="性别" onChange={handleSelectChange}>
176 180
                   <Option value="1">男</Option>
177
-                  <Option value="0">女</Option>
181
+                  <Option value="2">女</Option>
178 182
                 </Select>,
179 183
               )}
180 184
             </Form.Item>
@@ -186,9 +190,11 @@ function body(props) {
186 190
           </Col>
187 191
           <div style={{minWidth:'150px',position: 'absolute', right: '-12px', }}>
188 192
             <Form.Item >
193
+            <AuthButton name="admin.report.search" noRight={null}>
189 194
               <Button type="primary" htmlType="submit">
190 195
                 搜索
191 196
             </Button>
197
+            </AuthButton>
192 198
               <Button style={{ marginLeft: 8 }} onClick={handleReset}>
193 199
                 重置
194 200
             </Button>
@@ -198,9 +204,11 @@ function body(props) {
198 204
         <div >
199 205
         </div>
200 206
       </Form>
207
+      <AuthButton name="admin.report.import" noRight={null}>
201 208
       <Button type="primary" onClick={() => exportReport()} style={{ float: 'right', margin: '20px 0', zIndex: 1 }}>
202 209
         导出
203 210
       </Button>
211
+      </AuthButton>
204 212
       <Table rowKey="report" style={{ marginTop: '40px' }} dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />
205 213
     </>
206 214
   );

src/pages/customer/report/style.css → src/pages/record/report/style.css Прегледај датотеку


src/pages/customer/report/style.less → src/pages/record/report/style.less Прегледај датотеку


src/pages/customer/report/style.wxss → src/pages/record/report/style.wxss Прегледај датотеку


Неке датотеке нису приказане због велике количине промена