Просмотр исходного кода

Merge branch 'dev'

# Conflicts:
#	src/pages/customer/customerlist/index.jsx
魏超 5 лет назад
Родитель
Сommit
c10d0aeee2
47 измененных файлов: 2566 добавлений и 1829 удалений
  1. Двоичные данные
      public/favicon.png
  2. 11
    4
      src/components/GlobalHeader/AvatarDropdown.jsx
  3. 10
    3
      src/components/GlobalHeader/index.less
  4. 45
    0
      src/components/SelectButton/channelSelect.jsx
  5. 7
    6
      src/global.less
  6. 2
    2
      src/pages/activity/ActivityList.jsx
  7. 1
    0
      src/pages/activity/dataRecord/index.jsx
  8. 2
    0
      src/pages/activity/dataRecord/table/shareNum.jsx
  9. 6
    0
      src/pages/activity/dataRecord/table/shares.jsx
  10. 1
    1
      src/pages/activity/drainage/DrainageList.jsx
  11. 45
    39
      src/pages/activity/drainage/detailDrainage.jsx
  12. 250
    191
      src/pages/activity/editActivity.jsx
  13. 1
    1
      src/pages/activity/groupActivity/detailActivity.jsx
  14. 342
    324
      src/pages/activity/groupActivity/editGroupActivity.jsx
  15. 333
    309
      src/pages/activity/helpActivity/edithelpActivity.jsx
  16. 1
    0
      src/pages/building/list/add/components/base.jsx
  17. 3
    1
      src/pages/building/list/add/components/buildingProjectType.jsx
  18. 4
    0
      src/pages/building/list/add/components/imageSet.jsx
  19. 4
    0
      src/pages/building/list/add/components/modalImage.jsx
  20. 25
    5
      src/pages/carouselFigure/customImg/edit.jsx
  21. 10
    6
      src/pages/carouselFigure/customImg/list.jsx
  22. 1
    1
      src/pages/carouselFigure/editAdvertising.jsx
  23. 1
    1
      src/pages/carouselFigure/editCarousel.jsx
  24. 1
    1
      src/pages/carouselFigure/propaganda.jsx
  25. 8
    7
      src/pages/channel/brokerList.jsx
  26. 26
    14
      src/pages/channel/channelList.jsx
  27. 94
    48
      src/pages/channel/independentList/index.jsx
  28. 41
    24
      src/pages/channel/recommendClients.jsx
  29. 34
    25
      src/pages/customer/customerlist/components/BatchAssistConsultant.jsx
  30. 24
    21
      src/pages/customer/customerlist/components/assistConsultant.jsx
  31. 1
    1
      src/pages/customer/customerlist/components/integralRecord.jsx
  32. 1
    1
      src/pages/customer/customerlist/customerDetail.jsx
  33. 733
    719
      src/pages/customer/customerlist/index.jsx
  34. 1
    1
      src/pages/customer/customerlist/publicCustomerDetail.jsx
  35. 4
    4
      src/pages/indexEcharts/newUsers.jsx
  36. 1
    1
      src/pages/integralMall/editGoods.jsx
  37. 1
    1
      src/pages/news/list/editNewsList.jsx
  38. 24
    14
      src/pages/recommend/recommendCustomer/audit.jsx
  39. 129
    0
      src/pages/staff/components/BatchAssistConsultant.jsx
  40. 58
    0
      src/pages/staff/components/BuildingSelection.jsx
  41. 117
    0
      src/pages/staff/components/CustomerChange.jsx
  42. 107
    48
      src/pages/staff/list/StaffList.jsx
  43. 40
    4
      src/pages/staff/list/editStaff.jsx
  44. 2
    0
      src/pages/statistical/activity/shareNum.jsx
  45. 2
    0
      src/pages/statistical/activity/sharePersonNum.jsx
  46. 2
    1
      src/pages/statistical/consultant/index.jsx
  47. 10
    0
      src/services/apis.js

Двоичные данные
public/favicon.png Просмотреть файл


+ 11
- 4
src/components/GlobalHeader/AvatarDropdown.jsx Просмотреть файл

@@ -42,10 +42,12 @@ class AvatarDropdown extends React.Component {
42 42
   }
43 43
 
44 44
   render() {
45
+    console.log(this.props, 'props')
45 46
     const {
46 47
       currentUser = {
47 48
         avatar: '',
48 49
         userName: '',
50
+        miniAppName: '',
49 51
       },
50 52
       menu,
51 53
     } = this.props;
@@ -78,10 +80,15 @@ class AvatarDropdown extends React.Component {
78 80
     return currentUser && currentUser.userName ? (
79 81
       <>
80 82
         <HeaderDropdown overlay={menuHeaderDropdown}>
81
-            <span className={`${styles.action} ${styles.account}`}>
82
-              <Avatar size="small" className={styles.avatar} src={currentUser.avatar === null ? currentUser.photo:currentUser.avatar} alt="avatar" />
83
-              <span className={styles.name}>{currentUser.userName}</span>
84
-            </span>
83
+            <div className={`${styles.action} ${styles.account}`} style={{display:'flex'}}>
84
+              
85
+         <div style={{margin:'10px 0' }}>
86
+              <p align="right" className={styles.name}>{currentUser.loginName}</p>
87
+     
88
+              <p align="right" className={styles.name}>欢迎登录{currentUser.miniAppName}</p>
89
+          </div>
90
+          <Avatar size="small" className={styles.avatar} src={currentUser.avatar === null ? currentUser.photo:currentUser.avatar} alt="avatar" />
91
+            </div>
85 92
         </HeaderDropdown>
86 93
 
87 94
         {/* 修改密码 */}

+ 10
- 3
src/components/GlobalHeader/index.less Просмотреть файл

@@ -4,6 +4,11 @@
4 4
 .name {
5 5
 
6 6
   color: #fff;
7
+  padding: 0;
8
+  margin: 0;
9
+  height: 20px;
10
+  line-height: 20px;
11
+    
7 12
 }
8 13
 .logo {
9 14
   display: inline-block;
@@ -46,7 +51,7 @@
46 51
   .action {
47 52
     display: inline-block;
48 53
     height: 100%;
49
-    padding: 0 12px;
54
+    padding: 0 40px;
50 55
     cursor: pointer;
51 56
     transition: all 0.3s;
52 57
     > i {
@@ -68,8 +73,10 @@
68 73
   }
69 74
   .account {
70 75
     .avatar {
71
-      margin: ~'calc((@{layout-header-height} - 24px) / 2)' 0;
72
-      margin-right: 8px;
76
+      width: 44px;
77
+      height: 44px;
78
+      margin: ~'calc((@{layout-header-height} - 44px) / 2)' 0;
79
+      margin-left: 20px;
73 80
       color: @primary-color;
74 81
       vertical-align: top;
75 82
       background: rgba(255, 255, 255, 0.85);

+ 45
- 0
src/components/SelectButton/channelSelect.jsx Просмотреть файл

@@ -0,0 +1,45 @@
1
+import React, { useState, useEffect, useRef } from 'react';
2
+import { Select } from 'antd';
3
+import apis from '../../services/apis';
4
+import request from '../../utils/request'
5
+
6
+const { Option } = Select;
7
+
8
+/**
9
+ *
10
+ *
11
+ * @param {*} props
12
+ * @returns
13
+ */
14
+const ChannelSelect = props => {
15
+  const [data, setData] = useState([])
16
+  const [value, setValue] = useState([])
17
+  useEffect(() => {
18
+    getChannelSelect();
19
+  }, [props.value])
20
+
21
+
22
+  const getChannelSelect = e => {
23
+    request({ ...apis.channelList.getList, params: { pageNumber: 1, pageSize: 999 } }).then(data => {
24
+        setData(data.channelNmae)
25
+        // 默认选中第一个
26
+    })
27
+  }
28
+
29
+  return (
30
+      <Select
31
+      showSearch
32
+      value={props.value}
33
+      style={{ width: '250px' }}
34
+      placeholder="请选择渠道"
35
+      onChange={props.onChange}
36
+      filterOption={(input, option) =>
37
+        option.props.children && option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
38
+      }>
39
+          {data.map(Item => (
40
+            <Option key={Item.channelId} value={Item.channelId}> {Item.channelName} </Option>
41
+          ))}
42
+      </Select>
43
+  )
44
+}
45
+export default ChannelSelect

+ 7
- 6
src/global.less Просмотреть файл

@@ -10,12 +10,6 @@ body,
10 10
   filter: invert(80%);
11 11
 }
12 12
 
13
-.ant-layout {
14
-  min-height: 100vh;
15
-  background-color: #f8f8f8;
16
-  height: fit-content;
17
-}
18
-
19 13
 canvas {
20 14
   display: block;
21 15
 }
@@ -191,3 +185,10 @@ ol {
191 185
     border-top:none;
192 186
   }
193 187
 }
188
+:global {
189
+  .ant-layout {
190
+    min-height: 100vh;
191
+    background-color: #f8f8f8;
192
+    height: fit-content!important;
193
+  }  
194
+}

+ 2
- 2
src/pages/activity/ActivityList.jsx Просмотреть файл

@@ -43,7 +43,7 @@ const header = props => {
43 43
   }, [])
44 44
 
45 45
   // 跳转到编辑商品
46
-  const toEditGoods = dynamicId => () => {
46
+  const toEditGoods = dynamicId  => () => {
47 47
     router.push({
48 48
       pathname: '/activity/editActivity',
49 49
       query: {
@@ -196,7 +196,7 @@ const header = props => {
196 196
           {<span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={toDataReacord(row.dynamicId)}>数据记录<Icon type="form" className={styles.edit} /></span>}
197 197
           {/* </AuthButton> */}
198 198
           <AuthButton name="admin.buildingDynamic.update.put" noRight={null}>
199
-            {(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>}
199
+            {(row.activityStatus === 0 || row.activityStatus === 1) && <span style={{ color: '#FF925C', marginRight: '20px', cursor: 'pointer' }} onClick={toEditGoods(row.dynamicId,row.count)}>编辑<Icon type="form" className={styles.edit} /></span>}
200 200
           </AuthButton>
201 201
           
202 202
           {/* {(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>} */}

+ 1
- 0
src/pages/activity/dataRecord/index.jsx Просмотреть файл

@@ -46,6 +46,7 @@ const DataRecord = props => {
46 46
     return <>
47 47
         <div>
48 48
             <div>
49
+                <span>{data.activityName || '0'}</span>
49 50
                 <Icon type="question-circle" theme="filled" style={{ fontSize: '25px', color: '#F00', marginLeft: '30px' }} onClick={() => setShowHelp(true)} />
50 51
                 <Modal
51 52
                     title="指标说明(数据会存在一定时间延迟)"

+ 2
- 0
src/pages/activity/dataRecord/table/shareNum.jsx Просмотреть файл

@@ -51,6 +51,7 @@ const date = {
51 51
             if (records.sharePersonType === 'drift') { return '游客' }
52 52
             if (records.sharePersonType === 'customer') { return '普通客户' }
53 53
             if (records.sharePersonType === 'Realty Consultant') { return '置业顾问' }
54
+            if (records.sharePersonType === 'estate agent') { return '专业经纪人' }
54 55
           },
55 56
         },
56 57
         {
@@ -120,6 +121,7 @@ const date = {
120 121
                             <Option value="drift">游客</Option>
121 122
                             <Option value="customer">普通客户</Option>
122 123
                             <Option value="Realty Consultant">置业顾问</Option>
124
+                            <Option value="estate agent">专业经纪人</Option>
123 125
                         </Select>
124 126
                     )}
125 127
                 </Form.Item>

+ 6
- 0
src/pages/activity/dataRecord/table/shares.jsx Просмотреть файл

@@ -51,6 +51,10 @@ const header = props => {
51 51
         if (records.sharePersonType === 'drift') { return '游客' }
52 52
         if (records.sharePersonType === 'customer') { return '普通客户' }
53 53
         if (records.sharePersonType === 'Realty Consultant') { return '置业顾问' }
54
+        if (records.sharePersonType === 'estate agent') { return '专业经纪人' }
55
+      //   ESTATE_AGENT']:
56
+      //   return [{ isAgent: true }, '普通用户']
57
+      // case ROLE_CODE['CHANNEL_AGENT
54 58
       },
55 59
     },
56 60
     {
@@ -151,6 +155,8 @@ const header = props => {
151 155
               <Option value="drift">游客</Option>
152 156
               <Option value="customer">普通客户</Option>
153 157
               <Option value="Realty Consultant">置业顾问</Option>
158
+              <Option value="estate agent">专业经纪人</Option>
159
+              
154 160
             </Select>
155 161
           )}
156 162
         </Form.Item>

+ 1
- 1
src/pages/activity/drainage/DrainageList.jsx Просмотреть файл

@@ -9,7 +9,7 @@ import XForm, { FieldTypes } from '../../../components/XForm';
9 9
 import moment from 'moment';
10 10
 import AuthButton from '../../../components/AuthButton';
11 11
 import ImageUploader from '../../../components/XForm/ImageUpload';
12
-import BuildSelect from '../../../components/SelectButton/BuildSelect'
12
+import BuildSelect from '../../../components/SelectButton/BuildSelect2'
13 13
 import Prompt from 'umi/prompt';
14 14
 
15 15
 const toEditList = (row) => () => {

+ 45
- 39
src/pages/activity/drainage/detailDrainage.jsx Просмотреть файл

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

+ 250
- 191
src/pages/activity/editActivity.jsx Просмотреть файл

@@ -1,11 +1,12 @@
1 1
 import React, { useState, useEffect } from 'react';
2 2
 import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker, message, Upload } from 'antd';
3 3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import Prompt from 'umi/prompt';
5
+import router from 'umi/router';
4 6
 import styles from '../style/GoodsList.less';
5 7
 import apis from '../../services/apis';
6 8
 import moment from 'moment';
7
-import router from 'umi/router';
8
-import BuildSelect from '../../components/SelectButton/BuildSelect'
9
+import BuildSelect from '../../components/SelectButton/BuildSelect2'
9 10
 import XForm, { FieldTypes } from '../../components/XForm';
10 11
 import Wangedit from '../../components/Wangedit/Wangedit'
11 12
 import request from '../../utils/request'
@@ -16,7 +17,6 @@ import touxiang from '../../assets/touxiang.jpg';
16 17
 import poster1 from '../../assets/poster1.png';
17 18
 import poster2 from '../../assets/poster2.png';
18 19
 import xiaochengxu from '../../assets/xiaochengxu.png'
19
-import Prompt from 'umi/prompt';
20 20
 
21 21
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
22 22
 const { TextArea } = Input;
@@ -36,6 +36,9 @@ const BasicForm = props => {
36 36
   const [isEnlist, setIsEnlist] = useState(1)
37 37
   const [activityStatus, setActivityStatus] = useState(1)
38 38
   const [disable, setDisable] = useState(false)
39
+  const [data, setData] = useState(1)
40
+  const [showSignupTime, setShowSignupTime] = useState([])
41
+
39 42
 
40 43
   const radioOnChange = e => {
41 44
     setIsEnlist(e.target.value)
@@ -45,14 +48,15 @@ const BasicForm = props => {
45 48
 
46 49
   // 查询详情
47 50
   const getDynamicData = dynamicId => {
48
-    request({ ...apis.activity.details, params: { dynamicId } }).then((data) => {
49
-      console.log(data)
51
+    request({ ...apis.activity.details, params: { dynamicId } }).then(data => {
52
+ 
50 53
       data.activityTime = [moment(data.startDate), moment(data.endDate)]
51 54
       data.signupTime = [moment(data.enlistStart), moment(data.enlistEnd)]
52
-
55
+      // setSignupTime([moment(data.enlistStart), moment(data.enlistEnd)])
56
+      setData(data)
53 57
       setIsEnlist(data.isEnlist)
54 58
       setActivityStatus(data.activityStatus)
55
-      setDisable(data.activityStatus === 0 ? true : false)
59
+      setDisable(data.activityStatus === 0)
56 60
       props.form.setFieldsValue(data)
57 61
     })
58 62
   }
@@ -64,10 +68,33 @@ const BasicForm = props => {
64 68
       getDynamicData(dynamicId);
65 69
     }
66 70
   }, [])
71
+  const checkTime = () => {
72
+    function compareDate(dateTime1, dateTime2) {
73
+      return new Date(dateTime1) > new Date(dateTime2)
74
+    }
75
+    // 1)修改后的开始时间不得大于当前时间(会存在已经成功报名的用户)
76
+
77
+    // (2)修改后开始时间<当前时间<修改后结束时间:活动进行中
78
+
79
+    // (3)修改后结束时间<当前时间:活动已结束
80
+    if (showSignupTime[0]) {
81
+      // const date = data.signupTime
82
+      const nowDate = new Date()
83
+      // console.log(compareDate(nowDate, showSignupTime[0]))
84
+      if (compareDate(nowDate, showSignupTime[0])) {
85
+        return true
86
+      } else {
87
+        return '修改后的开始时间不得大于当前时间(会存在已经成功报名的用户)'
88
+      }
89
+    }
90
+    return true
91
+  }
92
+
67 93
 
68 94
   const handleSubmit = e => {
69 95
     e.preventDefault();
70 96
     props.form.validateFields((err, values) => {
97
+
71 98
       if (!err) {
72 99
         console.log('Received values of form: ', values);
73 100
         const { activityTime, signupTime } = values
@@ -82,6 +109,18 @@ const BasicForm = props => {
82 109
 
83 110
         console.log('submit data --->', values)
84 111
         if (dynamicId) {
112
+          const checks = checkTime()
113
+          if (checks != true) {
114
+            message.info(checks)
115
+            return
116
+          }
117
+          console.log(data.enlistNum,values.personNum,'143')
118
+
119
+          if (data.enlistNum > values.personNum) {
120
+            message.info('活动人数必须大于已报名人数')
121
+            return
122
+          }
123
+
85 124
           values.dynamicId = dynamicId
86 125
           request({ ...apis.activity.update, data: values }).then(data => {
87 126
             message.info('保存成功')
@@ -106,6 +145,22 @@ const BasicForm = props => {
106 145
       }
107 146
     });
108 147
   }
148
+  const changeTime = (value, date) => {
149
+    // console.log(value, data, '-----checkTime---------')
150
+    // console.log(props.form.getFieldsValue(), '--------time1-----------')
151
+    // let datas = data
152
+    // console.log(value, date, datas)
153
+    // datas.signupTime = date
154
+
155
+    // //   data.signupTime = [moment(data.enlistStart), moment(data.enlistEnd)]
156
+
157
+    // console.log(datas,'-------datas--------')
158
+    //   props.form.setFieldsValue(data)
159
+    setShowSignupTime(date)
160
+    // props.form.setFieldsValue(datas)
161
+    // // form.setFieldsValue
162
+    // console.log('-------1--------')
163
+  }
109 164
 
110 165
   const { getFieldDecorator } = props.form;
111 166
   return (
@@ -169,7 +224,7 @@ const BasicForm = props => {
169 224
                 message: '请选择活动时间',
170 225
               },
171 226
             ],
172
-          })(<RangePicker format="YYYY-MM-DD HH:mm" disabled={activityStatus === 0 ? true : false} />)}
227
+          })(<RangePicker format="YYYY-MM-DD HH:mm" />)}
173 228
         </Form.Item>
174 229
         <Form.Item label="活动地点">
175 230
           {getFieldDecorator('address', {
@@ -179,8 +234,9 @@ const BasicForm = props => {
179 234
                 message: '请输入活动地点',
180 235
               },
181 236
             ],
182
-          })(<Input disabled={activityStatus === 0 ? true : false} />)}
237
+          })(<Input />)}
183 238
         </Form.Item>
239
+        {/* disabled={activityStatus === 0 ? true : false} */}
184 240
         <Form.Item label="活动人数" help="当前活动最多可报名人数">
185 241
           {getFieldDecorator('personNum', {
186 242
             rules: [
@@ -188,8 +244,12 @@ const BasicForm = props => {
188 244
                 required: true,
189 245
                 message: '请输入活动人数',
190 246
               },
247
+              // {
248
+              //   min: data.personNum,min={data.personNum || 0}
249
+              //   message: '活动人数必须大于已报名人数',
250
+              // },
191 251
             ],
192
-          })(<Input type="number" disabled={activityStatus === 0 ? true : false} />)}
252
+          })(<Input type="number" />)}
193 253
         </Form.Item>
194 254
         <Form.Item label="用户携带人数" help="每个用户最多可携带参与活动的人数">
195 255
           {getFieldDecorator('maxEnlistByPerson', {
@@ -199,7 +259,7 @@ const BasicForm = props => {
199 259
                 message: '请输入用户携带人数',
200 260
               },
201 261
             ],
202
-          })(<Input type="number" min={1} disabled={activityStatus === 0 ? true : false} />)}
262
+          })(<Input type="number" min={1} />)}
203 263
         </Form.Item>
204 264
         <Form.Item label="活动详情">
205 265
           {getFieldDecorator('desc')(<Wangedit />)}
@@ -212,10 +272,11 @@ const BasicForm = props => {
212 272
                 message: '请选择报名时间',
213 273
               },
214 274
             ],
215
-          })(<RangePicker format="YYYY-MM-DD HH:mm" disabled={activityStatus === 0 ? true : false} />)}
275
+          })(<RangePicker format="YYYY-MM-DD HH:mm" onChange={changeTime} />)}
216 276
         </Form.Item>
217 277
         <Form.Item label="权重">
218 278
           {getFieldDecorator('heavy', {
279
+
219 280
             rules: [
220 281
               {
221 282
                 required: true,
@@ -240,211 +301,209 @@ const BasicForm = props => {
240 301
 
241 302
 const Basic = Form.create({ name: 'BasicForm' })(BasicForm);
242 303
 
243
-/**
244
- *
245
- *
246
- * @param {*} props
247
- * @returns
248
- */
249
-const Edit = props => {
250
-  const [tab, changeTab] = useState('basic')
251
-  const { dynamicId } = props.location.query
304
+const Poster = props => {
305
+  const { dynamicId } = props
306
+  const [inputValue, changeInput] = useState('')
307
+  const [textAreaValue, changeTextArea] = useState('')
308
+  const [imgValue, changeImg] = useState('')
309
+  const [posterId, setPosterId] = useState('')
252 310
 
311
+  useEffect(() => {
312
+    if (dynamicId) {
313
+      request({ ...apis.activity.poster, params: { targetId: dynamicId, targetType: 'activity' } }).then(data => {
253 314
 
254
-  const Poster = (props) => {
255
-    const [inputValue, changeInput] = useState('')
256
-    const [textAreaValue, changeTextArea] = useState('')
257
-    const [imgValue, changeImg] = useState('')
258
-    const [posterId, setPosterId] = useState('')
315
+        if (data.length > 0) {
316
+          setPosterId(data[0].posterId)
317
+          changeImg(data[0].posterImg)
318
+          changeTextArea(data[0].posterDescription)
319
+          changeInput(data[0].posterTitle)
320
+        }
321
+      }).catch(err => {
322
+        message.info(err.msg || err.message)
323
+      })
324
+    }
325
+    // getMiniappName()
326
+  }, [])
327
+  
328
+  // 获取小程序名称
329
+  // const [miniappName, setMiniappName] = useState('')
330
+  // function getMiniappName() {
331
+  //   request({ ...apis.building.getMiniappName }).then(res => {
332
+  //     console.log(res, "0000000000000")
333
+  //     setMiniappName(res)
334
+  //   })
335
+  // }
259 336
 
337
+  const submitPoster = () => {
260 338
     if (dynamicId) {
261
-      console.log(dynamicId, 'dynamicId')
262
-      useEffect(() => {
263
-        request({ ...apis.activity.poster, params: { targetId: dynamicId, targetType: 'activity' } }).then((data) => {
264
-          console.log(data, "2222")
265
-          if (data.length > 0) {
266
-            setPosterId(data[0].posterId)
267
-            changeImg(data[0].posterImg)
268
-            changeTextArea(data[0].posterDescription)
269
-            changeInput(data[0].posterTitle)
270
-          }
271
-        }).catch((err) => {
339
+      if (posterId) {
340
+        request({ ...apis.activity.updatePoster, urlData: { id: posterId }, data: { targetId: dynamicId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue } }).then(data => {
341
+          message.info('保存成功')
342
+        }).catch(err => {
272 343
           message.info(err.msg || err.message)
273 344
         })
274
-        getMiniappName()
275
-      }, [])
276
-    } else {
277
-      getMiniappName()
278
-    }
279
-    // 获取小程序名称
280
-    const [miniappName, setMiniappName] = useState('')
281
-    function getMiniappName() {
282
-      request({ ...apis.building.getMiniappName }).then(res => {
283
-        console.log(res, "0000000000000")
284
-        setMiniappName(res)
285
-      })
286
-    }
287
-
288
-    const submitPoster = () => {
289
-      if (dynamicId) {
290
-        if (posterId) {
291
-          request({ ...apis.activity.updatePoster, urlData: { id: posterId }, data: { targetId: dynamicId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
292
-            message.info("保存成功")
293
-          }).catch((err) => {
294
-            message.info(err.msg || err.message)
295
-          })
296
-        } else {
297
-          request({ ...apis.activity.addPoster, data: { targetId: dynamicId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
298
-            setPosterId(data.posterId)
299
-            message.info("保存成功")
300
-          }).catch((err) => {
301
-            message.info(err.msg || err.message)
302
-          })
303
-        }
304 345
       } else {
305
-        message.warn("请先保存基本信息数据")
346
+        request({ ...apis.activity.addPoster, data: { targetId: dynamicId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue } }).then(data => {
347
+          setPosterId(data.posterId)
348
+          message.info('保存成功')
349
+        }).catch(err => {
350
+          message.info(err.msg || err.message)
351
+        })
306 352
       }
353
+    } else {
354
+      message.warn('请先保存基本信息数据')
307 355
     }
356
+  }
308 357
 
309
-    return <div>
310
-      <div style={{ display: 'flex' }}>
311
-        <div style={{ width: '420px', height: '900px', display: 'inline-block', marginTop: '30px' }}>
312
-          <div style={{ width: '375px', height: '700px', backgroundColor: '#fff', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
313
-            <img style={{ width: '100%', height: '300px' }} src={imgValue ? imgValue : poster1} alt="" />
314
-            <div style={{ display: 'flex', alignItems: 'center', marginTop: '-24px' }}>
315
-              <img style={{ width: '70px', height: '70px', border: '4px solid #fff', borderRadius: '35px', marginLeft: '16px' }} src={touxiang} alt="" />
316
-              <span style={{ color: '#222', fontWeight: '600', margin: '24px 10px 0 14px', fontSize: '17px' }}>喵喵</span>
317
-              <span style={{ color: '#999', marginTop: '25px', fontSize: '17px' }}>邀您参与</span>
318
-              <span style={{ color: '#999', margin: '25px 0 0 60px', fontSize: '17px' }}>2019.09.21</span>
319
-            </div>
320
-            <p style={{
321
-              margin: '10px 20px',
322
-              fontSize: '20px',
323
-              color: '#222',
324
-              fontWeight: '600',
325
-              display: '-webkit-box',
326
-              lineClamp: '3',
327
-              height: '60px',
328
-              WebkitLineClamp: '2',
329
-              WebkitBoxOrient: 'vertical',
330
-              overflow: 'hidden',
331
-              textOverflow: 'ellipsis'
332
-            }}>{inputValue ? inputValue : '海报标题'}</p>
333
-
334
-            <img src={yinhao} style={{ width: '30px', marginLeft: '20px' }} alt="" />
335
-            <p style={{
336
-              margin: '16px 20px 28px 20px',
337
-              fontSize: '17px',
338
-              color: '#999',
339
-              display: '-webkit-box',
340
-              lineClamp: '3',
341
-              height: '72px',
342
-              WebkitLineClamp: '3',
343
-              WebkitBoxOrient: 'vertical',
344
-              overflow: 'hidden',
345
-              textOverflow: 'ellipsis'
346
-            }}>{textAreaValue ? textAreaValue : '海报描述'}</p>
347
-            <div style={{ backgroundColor: '#f1f1f1', padding: '22px 30px', boxShadow: '0px 6px 12px -4px #dcdcdc', position: 'relative' }}>
348
-              <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>长按识别小程序码</p>
349
-              <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>进入活动查看详情</p>
350
-              <img style={{ width: '80px', position: 'absolute', right: '30px', top: '10px' }} src={xiaochengxu} alt="" />
351
-            </div>
358
+  return <div>
359
+    <div style={{ display: 'flex' }}>
360
+      <div style={{ width: '420px', height: '900px', display: 'inline-block', marginTop: '30px' }}>
361
+        <div style={{ width: '375px', height: '700px', backgroundColor: '#fff', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
362
+          <img style={{ width: '100%', height: '300px' }} src={imgValue || poster1} alt="" />
363
+          <div style={{ display: 'flex', alignItems: 'center', marginTop: '-24px' }}>
364
+            <img style={{ width: '70px', height: '70px', border: '4px solid #fff', borderRadius: '35px', marginLeft: '16px' }} src={touxiang} alt="" />
365
+            <span style={{ color: '#222', fontWeight: '600', margin: '24px 10px 0 14px', fontSize: '17px' }}>喵喵</span>
366
+            <span style={{ color: '#999', marginTop: '25px', fontSize: '17px' }}>邀您参与</span>
367
+            <span style={{ color: '#999', margin: '25px 0 0 60px', fontSize: '17px' }}>2019.09.21</span>
352 368
           </div>
353
-          <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
354
-        </div>
369
+          <p style={{
370
+            margin: '10px 20px',
371
+            fontSize: '20px',
372
+            color: '#222',
373
+            fontWeight: '600',
374
+            display: '-webkit-box',
375
+            lineClamp: '3',
376
+            height: '60px',
377
+            WebkitLineClamp: '2',
378
+            WebkitBoxOrient: 'vertical',
379
+            overflow: 'hidden',
380
+            textOverflow: 'ellipsis',
381
+          }}>{inputValue || '海报标题'}</p>
355 382
 
356
-        <div >
357
-          <div style={{ display: 'flex', width: '100%', margin: '60px 0' }}>
358
-            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>活动海报图</p>
359
-            <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
360
-          </div>
361
-          <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px' }}>建议图片尺寸:640*670px,比例64:67,格式:jpg,用于普通活动海报</p>
362
-          <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
363
-            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
364
-            <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
365
-          </div>
366
-          <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
367
-            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报描述</p>
368
-            <TextArea rows={5} maxLength={1024} value={textAreaValue} onChange={e => changeTextArea(e.target.value)} />
383
+          <img src={yinhao} style={{ width: '30px', marginLeft: '20px' }} alt="" />
384
+          <p style={{
385
+            margin: '16px 20px 28px 20px',
386
+            fontSize: '17px',
387
+            color: '#999',
388
+            display: '-webkit-box',
389
+            lineClamp: '3',
390
+            height: '72px',
391
+            WebkitLineClamp: '3',
392
+            WebkitBoxOrient: 'vertical',
393
+            overflow: 'hidden',
394
+            textOverflow: 'ellipsis',
395
+          }}>{textAreaValue || '海报描述'}</p>
396
+          <div style={{ backgroundColor: '#f1f1f1', padding: '22px 30px', boxShadow: '0px 6px 12px -4px #dcdcdc', position: 'relative' }}>
397
+            <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>长按识别小程序码</p>
398
+            <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>进入活动查看详情</p>
399
+            <img style={{ width: '80px', position: 'absolute', right: '30px', top: '10px' }} src={xiaochengxu} alt="" />
369 400
           </div>
401
+        </div>
402
+        <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
403
+      </div>
370 404
 
405
+      <div >
406
+        <div style={{ display: 'flex', width: '100%', margin: '60px 0' }}>
407
+          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>活动海报图</p>
408
+          <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
409
+        </div>
410
+        <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px' }}>建议图片尺寸:640*670px,比例64:67,格式:jpg,用于普通活动海报</p>
411
+        <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
412
+          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
413
+          <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
414
+        </div>
415
+        <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
416
+          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报描述</p>
417
+          <TextArea rows={5} maxLength={1024} value={textAreaValue} onChange={e => changeTextArea(e.target.value)} />
371 418
         </div>
419
+
372 420
       </div>
373
-      <Button type="primary" onClick={submitPoster} style={{ margin: '40px 40px 40px 30vw' }}> 确定</Button>
374
-      <Button onClick={() => cancelPage()}>
375
-        取消
376
-      </Button>
377 421
     </div>
422
+    <Button type="primary" onClick={submitPoster} style={{ margin: '40px 40px 40px 30vw' }}> 确定</Button>
423
+    <Button onClick={() => cancelPage()}>
424
+      取消
425
+    </Button>
426
+  </div>
427
+}
378 428
 
379
-  }
380
-
429
+const Share = props => {
430
+  const { dynamicId } = props
431
+  const [inputValue, changeInput] = useState('')
432
+  const [imgValue, changeImg] = useState('')
433
+  const [shareContentId, setShareContentId] = useState('')
381 434
 
435
+  useEffect(() => {
436
+    if (dynamicId) {
437
+      request({ ...apis.activity.shareContent, params: { targetId: dynamicId, targetType: 'activity' } }).then(data => {
382 438
 
383
-  const Share = (props) => {
384
-    const [inputValue, changeInput] = useState('')
385
-    const [imgValue, changeImg] = useState('')
386
-    const [shareContentId, setShareContentId] = useState('')
439
+        if (data.length > 0) {
440
+          setShareContentId(data[0].shareContentId)
441
+          changeImg(data[0].shareContentImg)
442
+          changeInput(data[0].shareContentTitle)
443
+        }
444
+      }).catch(err => {
445
+        message.info(err.msg || err.message)
446
+      })
447
+    }
448
+  }, [dynamicId])
387 449
 
450
+  const submitShare = () => {
388 451
     if (dynamicId) {
389
-      useEffect(() => {
390
-        request({ ...apis.activity.shareContent, params: { targetId: dynamicId, targetType: 'activity' }, }).then((data) => {
391
-          console.log(data, "2222")
392
-          if (data.length > 0) {
393
-            setShareContentId(data[0].shareContentId)
394
-            changeImg(data[0].shareContentImg)
395
-            changeInput(data[0].shareContentTitle)
396
-          }
397
-        }).catch((err) => {
452
+      if (shareContentId) {
453
+        request({ ...apis.activity.updateShareContent, urlData: { id: shareContentId }, data: { targetId: dynamicId, shareContentType: 'activity', shareContentImg: imgValue, shareContentTitle: inputValue } }).then(data => {
454
+          message.info('保存成功')
455
+        }).catch(err => {
398 456
           message.info(err.msg || err.message)
399 457
         })
400
-      }, [dynamicId])
401
-    }
402
-
403
-    const submitShare = () => {
404
-      if (dynamicId) {
405
-        if (shareContentId) {
406
-          request({ ...apis.activity.updateShareContent, urlData: { id: shareContentId }, data: { targetId: dynamicId, shareContentType: 'activity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
407
-            message.info("保存成功")
408
-          }).catch((err) => {
409
-            message.info(err.msg || err.message)
410
-          })
411
-        } else {
412
-          request({ ...apis.activity.addShareContent, data: { targetId: dynamicId, shareContentType: 'activity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
413
-            setShareContentId(data.shareContentId)
414
-            message.info("保存成功")
415
-          }).catch(err => {
416
-            message.info(err.msg || err.message)
417
-          })
418
-        }
419 458
       } else {
420
-        message.warn("请先保存基本信息数据")
459
+        request({ ...apis.activity.addShareContent, data: { targetId: dynamicId, shareContentType: 'activity', shareContentImg: imgValue, shareContentTitle: inputValue } }).then(data => {
460
+          setShareContentId(data.shareContentId)
461
+          message.info('保存成功')
462
+        }).catch(err => {
463
+          message.info(err.msg || err.message)
464
+        })
421 465
       }
466
+    } else {
467
+      message.warn('请先保存基本信息数据')
422 468
     }
469
+  }
423 470
 
424
-    return <div style={{ padding: '20px' }}>
425
-      <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
426
-        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享模板</p>
427
-        <div>
428
-          <p style={{ display: 'flex', alignItems: 'center', fontSize: '14px', color: '#999', margin: '0', lineHeight: '0' }}><img src={logo} style={{ width: '22px', marginRight: '10px' }} />橙蕉互动</p>
429
-          <p style={{ fontSize: '16px', color: '#222', fontWeight: '600', margin: '0' }}>{inputValue ? inputValue : '置业V客厅 精准获客平台'}</p>
430
-          <img style={{ width: '200px', height: '160px' }} src={imgValue ? imgValue : poster2} alt="" />
431
-        </div>
432
-      </div>
433
-      <div style={{ display: 'flex', alignItems: 'center', width: '100%' }}>
434
-        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享标题</p>
435
-        <Input placeholder="请输入分享标题" value={inputValue} onChange={e => changeInput(e.target.value)} />
436
-      </div>
437
-      <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
438
-        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>活动分享图</p>
439
-        <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
471
+  return <div style={{ padding: '20px' }}>
472
+    <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
473
+      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享模板</p>
474
+      <div>
475
+        <p style={{ display: 'flex', alignItems: 'center', fontSize: '14px', color: '#999', margin: '0', lineHeight: '0' }}>
476
+          <img src={logo} style={{ width: '22px', marginRight: '10px' }} alt=""/>橙蕉互动</p>
477
+        <p style={{ fontSize: '16px', color: '#222', fontWeight: '600', margin: '0' }}>{inputValue || '置业V客厅 精准获客平台'}</p>
478
+        <img style={{ width: '200px', height: '160px' }} src={imgValue || poster2} alt="" />
440 479
       </div>
441
-      <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginTop: '20px' }}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于活动分享好友</p>
442
-      <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
443
-      <Button onClick={() => cancelPage()}>
444
-        取消
445
-      </Button>
446 480
     </div>
447
-  }
481
+    <div style={{ display: 'flex', alignItems: 'center', width: '100%' }}>
482
+      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享标题</p>
483
+      <Input placeholder="请输入分享标题" value={inputValue} onChange={e => changeInput(e.target.value)} />
484
+    </div>
485
+    <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
486
+      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>活动分享图</p>
487
+      <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
488
+    </div>
489
+    <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginTop: '20px' }}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于活动分享好友</p>
490
+    <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
491
+    <Button onClick={() => cancelPage()}>
492
+      取消
493
+    </Button>
494
+  </div>
495
+}
496
+
497
+
498
+/**
499
+ *
500
+ *
501
+ * @param {*} props
502
+ * @returns
503
+ */
504
+const Edit = props => {
505
+  const [tab, changeTab] = useState('basic')
506
+  const { dynamicId } = props.location.query
448 507
 
449 508
   return (
450 509
     <div>
@@ -457,13 +516,13 @@ const Edit = props => {
457 516
       </div>
458 517
       <div>
459 518
         {tab === 'basic' && <Basic dynamicId={dynamicId} />}
460
-        {tab === 'poster' && <Poster />}
461
-        {tab === 'share' && <Share />}
519
+        {tab === 'poster' && <Poster dynamicId={dynamicId}/>}
520
+        {tab === 'share' && <Share dynamicId={dynamicId}/>}
462 521
       </div>
463 522
       <Prompt message={location =>
464
-        location.pathname.startsWith("/activity/ActivityList")
523
+        (location.pathname.startsWith('/activity/ActivityList')
465 524
           ? true
466
-          : location.pathname.startsWith("/activity/detailActivity") ? true : localStorage.removeItem("activePageParams")} />
525
+          : (location.pathname.startsWith("/activity/detailActivity") ? true : localStorage.removeItem("activePageParams")))} />
467 526
     </div>
468 527
   );
469 528
 }

+ 1
- 1
src/pages/activity/groupActivity/detailActivity.jsx Просмотреть файл

@@ -121,7 +121,7 @@ const BasicForm = props => {
121 121
           <img src={detailData.bannerListImg} height="125px" width="375px" />
122 122
         </Form.Item>
123 123
         <Form.Item label="活动时间">
124
-          <span>{`${moment(detailData.startDate).format('YYYY-MM-DD HH:mm:ss')} —— ${moment(detailData.endDate).format('YYYY-MM-DD HH:mm:ss')}`}</span>
124
+      <span>{`${moment(detailData.startTime).format('YYYY-MM-DD HH:mm:ss')} —— ${moment(detailData.endTime).format('YYYY-MM-DD HH:mm:ss')}`}</span>
125 125
         </Form.Item>
126 126
         <Form.Item label="成团人数">
127 127
             <span>{detailData.groupBuyPeople}</span>

+ 342
- 324
src/pages/activity/groupActivity/editGroupActivity.jsx Просмотреть файл

@@ -5,7 +5,7 @@ import styles from '../../style/GoodsList.less';
5 5
 import apis from '../../../services/apis';
6 6
 import moment from 'moment';
7 7
 import router from 'umi/router';
8
-import BuildSelect from '../../../components/SelectButton/BuildSelect'
8
+import BuildSelect from '../../../components/SelectButton/BuildSelect2'
9 9
 import XForm, { FieldTypes } from '../../../components/XForm';
10 10
 import Wangedit from '../../../components/Wangedit/Wangedit'
11 11
 import request from '../../../utils/request'
@@ -27,367 +27,385 @@ const cancelPage = () => {
27 27
   });
28 28
 }
29 29
 
30
-/**
31
- *
32
- *
33
- * @param {*} props
34
- * @returns
35
- */
36
-const Edit = props => {
37
-  const [tab, changeTab] = useState('basic')
38
-  // 判断是否展示助力次数的输入框
39
-  const { groupActivityId } = props.location.query
40
-  const [dynamicData, setDynamicData] = useState({ isEnlist: 1 })
41
-  const [scoreData, setScoreData] = useState({})
42
-  const [activityStatus, setActivityStatus] = useState({})
43
-  const [disable, setDisable] = useState(false)
44 30
 
45
-  useEffect(() => {
46
-    request(apis.groupActivity.avgScore).then((data) => {
47
-      setScoreData(data);
48
-    })
49
-  }, [])
31
+const Basic = props => {
32
+  const { dynamicData, disable, activityStatus, scoreData, groupActivityId } = props;
50 33
 
51
-    useEffect(() => {
52
-      if (groupActivityId) {
53
-      getDynamicData(groupActivityId);
54
-    }
55
-    }, [groupActivityId])
34
+  const fields = [
35
+    {
36
+      label: '选择项目',
37
+      name: 'buildingId',
38
+      render: <BuildSelect disabled={disable}/>,
39
+      value: dynamicData.buildingId,
40
+      rules: [
41
+        { required: true, message: '请选择项目' },
42
+      ],
43
+    },
44
+    {
45
+      label: '活动标题',
46
+      name: 'activityName',
47
+      type: FieldTypes.Text,
48
+      value: dynamicData.activityName,
49
+      rules: [
50
+        { required: true, message: '请输入活动标题' },
51
+      ]
52
+    },
53
+    {
54
+      label: '拼团详情主图',
55
+      name: 'mainImg',
56
+      type: FieldTypes.ImageUploader,
57
+      value: dynamicData.mainImg,
58
+      rules: [
59
+        { required: true, message: '请输入拼团详情主图' },
60
+      ],
61
+      help: '建议图片尺寸:750*600px,比例5:4,格式:jpg,用于:拼团活动详情',
62
+    },
63
+    {
64
+      label: '拼团封面图1',
65
+      name: 'listImg',
66
+      type: FieldTypes.ImageUploader,
67
+      value: dynamicData.listImg,
68
+      rules: [
69
+        { required: true, message: '请输入拼团封面图1' },
70
+      ],
71
+      help: '建议图片尺寸:750*420px,比例16:9,格式:jpg,用于:活动列表/首页推荐',
72
+    },
73
+    {
74
+      label: '拼团封面图2',
75
+      name: 'bannerListImg',
76
+      type: FieldTypes.ImageUploader,
77
+      value: dynamicData.bannerListImg,
78
+      rules: [
79
+        { required: true, message: '请输入拼团封面图2' },
80
+      ],
81
+      help: '建议图片尺寸:750*250px,比例3:1,格式:jpg,用于:项目详情页',
82
+    },
83
+    {
84
+      label: '活动时间',
85
+      name: 'activityTime',
86
+      type: FieldTypes.RangePicker,
87
+      value: dynamicData.startTime != null ? [moment(dynamicData.startTime, 'YYYY-MM-DD HH:mm'), moment(dynamicData.endTime, 'YYYY-MM-DD HH:mm')] : null,
88
+      props: { showTime: { format: 'HH:mm' } },
89
+      rules: [
90
+        { required: true, message: '请选择活动时间' },
91
+      ],
92
+    },
93
+    {
94
+      label: '成团人数',
95
+      name: 'groupBuyPeople',
96
+      type: FieldTypes.Text,
97
+      value: dynamicData.groupBuyPeople,
98
+      props: { disabled: activityStatus === 0 },
99
+      help: '注:成团所需人数',
100
+      rules: [
101
+        { required: true, message: '请输入成团人数' },
102
+      ]
103
+    },
104
+    {
105
+      label: '所需积分',
106
+      name: 'integral',
107
+      type: FieldTypes.Text,
108
+      value: dynamicData.integral,
109
+      props: { disabled: activityStatus === 0 },
110
+      help: `注:用户平均积分${scoreData.averageScore}`,
111
+      rules: [
112
+        { required: true, message: '请输入所需积分' },
113
+      ]
114
+    },
115
+    {
116
+      label: '活动说明',
117
+      name: 'descImg',
118
+      type: FieldTypes.ImageUploader,
119
+      value: dynamicData.descImg,
120
+      rules: [
121
+        { required: true, message: '请输入活动说明' },
122
+      ],
123
+      help: '建议宽度:750px,高度不限,格式:jpg,用于活动详情',
124
+    },
125
+    {
126
+      label: '权重',
127
+      name: 'heavy',
128
+      type: FieldTypes.Number,
129
+      render: <Input type="number" style={{ width: 80}} />,
130
+      value: dynamicData.heavy,
131
+      rules: [
132
+        { required: true, message: '请输入权重' },
133
+      ],
134
+      help: '数字越大越靠前',
135
+    },
136
+  ]
56 137
 
57
-    // 详情
58
-    const getDynamicData = (groupActivityId) => {
59
-      request({ ...apis.groupActivity.details, urlData: { id: groupActivityId } }).then((data) => {
60
-        setDynamicData(data)
61
-        setActivityStatus(data.activityStatus)
62
-        setDisable(data.activityStatus === 0 ? true : false)
63
-      })
138
+  function compareDate(dateTime1, dateTime2) {
139
+    return new Date(dateTime1) > new Date(dateTime2);
64 140
   }
65 141
 
66
-  const radioOnChange = e => {
67
-    console.log(e.target.value)
68
-    setDynamicData({ ...dynamicData, isEnlist: e.target.value })
69
-  }
142
+  const handleSubmit = val => {
143
+    const { activityTime, signupTime, ...submitValue } = val
70 144
 
71
-  const Basic = props => {
72
-    const fields = [
73
-      {
74
-        label: '选择项目',
75
-        name: 'buildingId',
76
-        render: <BuildSelect disabled={disable}/>,
77
-        value: dynamicData.buildingId,
78
-        rules: [
79
-          { required: true, message: '请选择项目' },
80
-        ],
81
-      },
82
-      {
83
-        label: '活动标题',
84
-        name: 'activityName',
85
-        type: FieldTypes.Text,
86
-        value: dynamicData.activityName,
87
-        rules: [
88
-          { required: true, message: '请输入活动标题' },
89
-        ]
90
-      },
91
-      {
92
-        label: '拼团详情主图',
93
-        name: 'mainImg',
94
-        type: FieldTypes.ImageUploader,
95
-        value: dynamicData.mainImg,
96
-        rules: [
97
-          { required: true, message: '请输入拼团详情主图' },
98
-        ],
99
-        help: '建议图片尺寸:750*600px,比例5:4,格式:jpg,用于:拼团活动详情',
100
-      },
101
-      {
102
-        label: '拼团封面图1',
103
-        name: 'listImg',
104
-        type: FieldTypes.ImageUploader,
105
-        value: dynamicData.listImg,
106
-        rules: [
107
-          { required: true, message: '请输入拼团封面图1' },
108
-        ],
109
-        help: '建议图片尺寸:750*420px,比例16:9,格式:jpg,用于:活动列表/首页推荐',
110
-      },
111
-      {
112
-        label: '拼团封面图2',
113
-        name: 'bannerListImg',
114
-        type: FieldTypes.ImageUploader,
115
-        value: dynamicData.bannerListImg,
116
-        rules: [
117
-          { required: true, message: '请输入拼团封面图2' },
118
-        ],
119
-        help: '建议图片尺寸:750*250px,比例3:1,格式:jpg,用于:项目详情页',
120
-      },
121
-      {
122
-        label: '活动时间',
123
-        name: 'activityTime',
124
-        type: FieldTypes.RangePicker,
125
-        value: dynamicData.startTime != null ? [moment(dynamicData.startTime, 'YYYY-MM-DD HH:mm'), moment(dynamicData.endTime, 'YYYY-MM-DD HH:mm')] : null,
126
-        props: { showTime: { format: 'HH:mm' }, disabled: activityStatus === 0 ? true : false },
127
-        rules: [
128
-          { required: true, message: '请选择活动时间' },
129
-        ],
130
-      },
131
-      {
132
-        label: '成团人数',
133
-        name: 'groupBuyPeople',
134
-        type: FieldTypes.Text,
135
-        value: dynamicData.groupBuyPeople,
136
-        props: {disabled: activityStatus === 0 ? true : false },
137
-        help: '注:成团所需人数',
138
-        rules: [
139
-          { required: true, message: '请输入成团人数' },
140
-        ]
141
-      },
142
-      {
143
-        label: '所需积分',
144
-        name: 'integral',
145
-        type: FieldTypes.Text,
146
-        value: dynamicData.integral,
147
-        props: {disabled: activityStatus === 0 ? true : false },
148
-        help: '注:用户平均积分' + scoreData.averageScore,
149
-        rules: [
150
-          { required: true, message: '请输入所需积分' },
151
-        ]
152
-      },
153
-      {
154
-        label: '活动说明',
155
-        name: 'descImg',
156
-        type: FieldTypes.ImageUploader,
157
-        value: dynamicData.descImg,
158
-        rules: [
159
-          { required: true, message: '请输入活动说明' },
160
-        ],
161
-        help: '建议宽度:750px,高度不限,格式:jpg,用于活动详情',
162
-      },
163
-      {
164
-        label: '权重',
165
-        name: 'heavy',
166
-        type: FieldTypes.Number,
167
-        render: <Input type="number" style={{ width: 80}} />,
168
-        value: dynamicData.heavy,
169
-        rules: [
170
-          { required: true, message: '请输入权重' },
171
-        ],
172
-        help: '数字越大越靠前',
173
-      },
174
-    ]
145
+    const [startTime, endTime] = activityTime
146
+    submitValue.startTime = moment(startTime).format('YYYY-MM-DD HH:mm');
147
+    submitValue.endTime = moment(endTime).format('YYYY-MM-DD HH:mm');
175 148
 
176
-    const handleSubmit = val => {
177
-      const { activityTime, signupTime, ...submitValue } = val
178
-      console.log('val', val)
179
-      const [startTime, endTime] = activityTime
180
-      submitValue.startTime = moment(startTime).format('YYYY-MM-DD HH:mm');
181
-      submitValue.endTime = moment(endTime).format('YYYY-MM-DD HH:mm');
182
-      console.log('submit data --->', submitValue)
183
-      if (groupActivityId) {
184
-        submitValue.groupActivityId = groupActivityId
185
-        request({ ...apis.groupActivity.update, data: submitValue }).then((data) => {
186
-          message.info("保存成功")
187
-          // cancelPage()
188
-        }).catch((err) => {
189
-          // message.info(err.msg || err.message)
190
-        })
191
-      } else {
192
-        request({ ...apis.groupActivity.add, data: submitValue }).then((data) => {
193
-          router.push({
194
-            pathname: '/activity/groupActivity/editGroupActivity',
195
-            query: {
196
-              groupActivityId: data,
197
-            },
198
-          });
199
-          message.info("保存成功")
200
-          // cancelPage()
201
-        }).catch((err) => {
202
-          // message.info(err.msg || err.message)
203
-        })
149
+    if (groupActivityId) {
150
+      const nowDate = new Date()
151
+      if (!compareDate(nowDate, startTime)) {
152
+        message.info('修改后的开始时间不得大于当前时间(会存在已经成功助力或者发起助力的用户)')
153
+        return
204 154
       }
155
+      submitValue.groupActivityId = groupActivityId
156
+      request({ ...apis.groupActivity.update, data: submitValue }).then(data => {
157
+        message.info('保存成功')
158
+        // cancelPage()
159
+      }).catch(() => {
160
+        // message.info(err.msg || err.message)
161
+      })
162
+    } else {
163
+      request({ ...apis.groupActivity.add, data: submitValue }).then(data => {
164
+        router.push({
165
+          pathname: '/activity/groupActivity/editGroupActivity',
166
+          query: {
167
+            groupActivityId: data,
168
+          },
169
+        });
170
+        message.info("保存成功")
171
+        // cancelPage()
172
+      }).catch(() => {
173
+        // message.info(err.msg || err.message)
174
+      })
205 175
     }
206
-
207
-    return <XForm onSubmit={handleSubmit} onCancel={cancelPage} fields={fields}></XForm>
208 176
   }
209 177
 
210
-  const Poster = (props) => {
211
-    const [inputValue, changeInput] = useState('')
212
-    const [textAreaValue, changeTextArea] = useState('')
213
-    const [imgValue, changeImg] = useState('')
214
-    const [posterId, setPosterId] = useState('')
178
+  return <XForm onSubmit={handleSubmit} onCancel={cancelPage} fields={fields}></XForm>
179
+}
215 180
 
181
+const Poster = props => {
182
+  const { groupActivityId } = props;
183
+  const [inputValue, changeInput] = useState('')
184
+  const [textAreaValue, changeTextArea] = useState('')
185
+  const [imgValue, changeImg] = useState('')
186
+  const [posterId, setPosterId] = useState('')
187
+  // const [miniappName, setMiniappName] = useState('')
188
+
189
+  useEffect(() => {
216 190
     if (groupActivityId) {
217
-      console.log(groupActivityId, 'groupActivityId')
218
-      useEffect(() => {
219
-        request({ ...apis.activity.poster, params: { targetId: groupActivityId, targetType: 'groupActivity' } }).then((data) => {
220
-          if (data.length > 0) {
221
-            setPosterId(data[0].posterId)
222
-            changeImg(data[0].posterImg)
223
-            changeTextArea(data[0].posterDescription)
224
-            changeInput(data[0].posterTitle)
225
-          }
226
-        }).catch((err) => {
227
-          message.info(err.msg || err.message)
228
-        })
229
-        getMiniappName()
230
-      }, [])
231
-    }else{
232
-      getMiniappName()
233
-    }
234
-    // 获取小程序名称
235
-    const [miniappName, setMiniappName] = useState('')
236
-    function getMiniappName() {
237
-      request({ ...apis.building.getMiniappName }).then(res => {
238
-        console.log(res, "0000000000000")
239
-        setMiniappName(res)
191
+      request({ ...apis.activity.poster, params: { targetId: groupActivityId, targetType: 'groupActivity' } }).then(data => {
192
+        if (data.length > 0) {
193
+          setPosterId(data[0].posterId)
194
+          changeImg(data[0].posterImg)
195
+          changeTextArea(data[0].posterDescription)
196
+          changeInput(data[0].posterTitle)
197
+        }
198
+      }).catch(err => {
199
+        message.info(err.msg || err.message)
240 200
       })
241 201
     }
242 202
 
243
-    const submitPoster = () => {
244
-      if (groupActivityId) {
245
-        if (posterId) {
246
-          request({ ...apis.activity.updatePoster, urlData: { id: posterId }, data: { targetId: groupActivityId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
247
-            message.info("保存成功")
248
-          }).catch((err) => {
249
-            message.info(err.msg || err.message)
250
-          })
251
-        } else {
252
-          request({ ...apis.activity.addPoster, data: { targetId: groupActivityId, targetType: 'groupActivity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
253
-            setPosterId(data.posterId)
254
-            message.info("保存成功")
255
-          }).catch((err) => {
256
-            message.info(err.msg || err.message)
257
-          })
258
-        }
203
+    // getMiniappName()
204
+  }, [])
205
+
206
+  // // 获取小程序名称
207
+  // function getMiniappName() {
208
+  //   request({ ...apis.building.getMiniappName }).then(res => {
209
+  //     setMiniappName(res)
210
+  //   })
211
+  // }
212
+
213
+  const submitPoster = () => {
214
+    if (groupActivityId) {
215
+      if (posterId) {
216
+        request({ ...apis.activity.updatePoster, urlData: { id: posterId }, data: { targetId: groupActivityId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then(data => {
217
+          message.info('保存成功')
218
+        }).catch(err => {
219
+          message.info(err.msg || err.message)
220
+        })
259 221
       } else {
260
-        message.warn("请先保存基本信息数据")
222
+        request({ ...apis.activity.addPoster, data: { targetId: groupActivityId, targetType: 'groupActivity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then(data => {
223
+          setPosterId(data.posterId)
224
+          message.info('保存成功')
225
+        }).catch(err => {
226
+          message.info(err.msg || err.message)
227
+        })
261 228
       }
229
+    } else {
230
+      message.warn('请先保存基本信息数据')
262 231
     }
232
+  }
263 233
 
264
-    return <div>
265
-      <div style={{ display: 'flex' }}>
266
-        <div style={{ width: '420px', height: '900px', display: 'inline-block', marginTop: '30px' }}>
267
-          <div style={{ width: '375px', height: '700px', backgroundColor: '#fff', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
268
-            <img style={{ width: '100%', height: '300px' }} src={imgValue ? imgValue : poster1} alt="" />
269
-            <div style={{ display: 'flex', alignItems: 'center', marginTop: '-24px' }}>
270
-              <img style={{ width: '70px', height: '70px', border: '4px solid #fff', borderRadius: '35px', marginLeft: '16px' }} src={touxiang} alt="" />
271
-              <span style={{ color: '#222', fontWeight: '600', margin: '24px 10px 0 14px', fontSize: '17px' }}>喵喵</span>
272
-              <span style={{ color: '#999', marginTop: '25px', fontSize: '17px' }}>邀您参与</span>
273
-              <span style={{ color: '#999', margin: '25px 0 0 60px', fontSize: '17px' }}>2019.09.21</span>
274
-            </div>
275
-            <p style={{
276
-              margin: '10px 20px', fontSize: '20px', color: '#222', fontWeight: '600',
277
-              display: '-webkit-box', lineClamp: '3', 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', fontSize: '17px', color: '#999',
287
-              display: '-webkit-box', lineClamp: '3', height: '72px',
288
-              WebkitLineClamp: '3',
289
-              WebkitBoxOrient: 'vertical',
290
-              overflow: 'hidden',
291
-              textOverflow: 'ellipsis'
292
-            }}>{textAreaValue ? textAreaValue : '海报描述'}</p>
293
-            <div style={{ backgroundColor: '#f1f1f1', padding: '22px 30px', boxShadow: '0px 6px 12px -4px #dcdcdc', position: 'relative' }}>
294
-              <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>长按识别小程序码</p>
295
-              <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>进入活动查看详情</p>
296
-              <img style={{ width: '80px', position: 'absolute', right: '30px', top: '10px' }} src={xiaochengxu} alt="" />
297
-            </div>
234
+  return <div>
235
+    <div style={{ display: 'flex' }}>
236
+      <div style={{ width: '420px', height: '900px', display: 'inline-block', marginTop: '30px' }}>
237
+        <div style={{ width: '375px', height: '700px', backgroundColor: '#fff', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
238
+          <img style={{ width: '100%', height: '300px' }} src={imgValue || poster1} alt="" />
239
+          <div style={{ display: 'flex', alignItems: 'center', marginTop: '-24px' }}>
240
+            <img style={{ width: '70px', height: '70px', border: '4px solid #fff', borderRadius: '35px', marginLeft: '16px' }} src={touxiang} alt="" />
241
+            <span style={{ color: '#222', fontWeight: '600', margin: '24px 10px 0 14px', fontSize: '17px' }}>喵喵</span>
242
+            <span style={{ color: '#999', marginTop: '25px', fontSize: '17px' }}>邀您参与</span>
243
+            <span style={{ color: '#999', margin: '25px 0 0 60px', fontSize: '17px' }}>2019.09.21</span>
298 244
           </div>
299
-          <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
300
-        </div>
245
+          <p style={{
246
+            margin: '10px 20px',
247
+            fontSize: '20px',
248
+            color: '#222',
249
+            fontWeight: '600',
250
+            display: '-webkit-box',
251
+            lineClamp: '3',
252
+            height: '60px',
253
+            WebkitLineClamp: '2',
254
+            WebkitBoxOrient: 'vertical',
255
+            overflow: 'hidden',
256
+            textOverflow: 'ellipsis',
257
+          }}>{inputValue || '海报标题'}</p>
301 258
 
302
-        <div >
303
-          <div style={{ display: 'flex', width: '100%', margin: '60px 0' }}>
304
-            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>拼团海报图</p>
305
-            <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
306
-          </div>
307
-          <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:750*600,比例5:4,格式:jpg,用于拼团活动海报</p>
308
-          <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
309
-            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
310
-            <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
311
-          </div>
312
-          <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
313
-            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报描述</p>
314
-            <TextArea rows={5} maxLength={1024} value={textAreaValue} onChange={e => changeTextArea(e.target.value)} />
259
+          <img src={yinhao} style={{ width: '30px', marginLeft: '20px' }} alt="" />
260
+          <p style={{
261
+            margin: '16px 20px 28px 20px',
262
+            fontSize: '17px',
263
+            color: '#999',
264
+            display: '-webkit-box',
265
+            lineClamp: '3',
266
+            height: '72px',
267
+            WebkitLineClamp: '3',
268
+            WebkitBoxOrient: 'vertical',
269
+            overflow: 'hidden',
270
+            textOverflow: 'ellipsis',
271
+          }}>{ textAreaValue || '海报描述'}</p>
272
+          <div style={{ backgroundColor: '#f1f1f1', padding: '22px 30px', boxShadow: '0px 6px 12px -4px #dcdcdc', position: 'relative' }}>
273
+            <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>长按识别小程序码</p>
274
+            <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>进入活动查看详情</p>
275
+            <img style={{ width: '80px', position: 'absolute', right: '30px', top: '10px' }} src={xiaochengxu} alt="" />
315 276
           </div>
277
+        </div>
278
+        <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
279
+      </div>
316 280
 
281
+      <div >
282
+        <div style={{ display: 'flex', width: '100%', margin: '60px 0' }}>
283
+          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>拼团海报图</p>
284
+          <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
317 285
         </div>
286
+        <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:750*600,比例5:4,格式:jpg,用于拼团活动海报</p>
287
+        <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
288
+          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
289
+          <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
290
+        </div>
291
+        <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
292
+          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报描述</p>
293
+          <TextArea rows={5} maxLength={1024} value={textAreaValue} onChange={e => changeTextArea(e.target.value)} />
294
+        </div>
295
+
318 296
       </div>
319
-      <Button type="primary" onClick={submitPoster} style={{ margin: '40px 40px 40px 30vw' }}> 确定</Button>
320
-      <Button onClick={() => cancelPage()}>取消</Button>
321 297
     </div>
322
-
323
-  }
298
+    <Button type="primary" onClick={submitPoster} style={{ margin: '40px 40px 40px 30vw' }}> 确定</Button>
299
+    <Button onClick={() => cancelPage()}>取消</Button>
300
+  </div>
301
+}
324 302
 
325 303
 
304
+const Share = props => {
305
+  const { groupActivityId } = props
306
+  const [inputValue, changeInput] = useState('')
307
+  const [imgValue, changeImg] = useState('')
308
+  const [shareContentId, setShareContentId] = useState('')
326 309
 
327
-  const Share = (props) => {
328
-    const [inputValue, changeInput] = useState('')
329
-    const [imgValue, changeImg] = useState('')
330
-    const [shareContentId, setShareContentId] = useState('')
310
+  useEffect(() => {
311
+      if (groupActivityId) {
312
+      request({ ...apis.activity.shareContent, params: { targetId: groupActivityId, targetType: 'groupActivity' } }).then(data => {
313
+        if (data.length > 0) {
314
+          setShareContentId(data[0].shareContentId)
315
+          changeImg(data[0].shareContentImg)
316
+          changeInput(data[0].shareContentTitle)
317
+        }
318
+      }).catch(err => {
319
+        message.info(err.msg || err.message)
320
+      })
321
+    }
322
+  }, [])
331 323
 
324
+  const submitShare = () => {
332 325
     if (groupActivityId) {
333
-      useEffect(() => {
334
-        request({ ...apis.activity.shareContent, params: { targetId: groupActivityId, targetType: 'groupActivity' }, }).then((data) => {
335
-          console.log(data, "2222")
336
-          if (data.length > 0) {
337
-            setShareContentId(data[0].shareContentId)
338
-            changeImg(data[0].shareContentImg)
339
-            changeInput(data[0].shareContentTitle)
340
-          }
341
-        }).catch((err) => {
326
+      if (shareContentId) {
327
+        request({ ...apis.activity.updateShareContent, urlData: { id: shareContentId }, data: { targetId: groupActivityId, shareContentType: 'groupActivity', shareContentImg: imgValue, shareContentTitle: inputValue } }).then(data => {
328
+          message.info('保存成功')
329
+        }).catch(err => {
342 330
           message.info(err.msg || err.message)
343 331
         })
344
-      }, [])
345
-    }
346
-
347
-    const submitShare = () => {
348
-      if (groupActivityId) {
349
-        if (shareContentId) {
350
-          request({ ...apis.activity.updateShareContent, urlData: { id: shareContentId }, data: { targetId: groupActivityId, shareContentType: 'groupActivity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
351
-            message.info("保存成功")
352
-          }).catch((err) => {
353
-            message.info(err.msg || err.message)
354
-          })
355
-        } else {
356
-          request({ ...apis.activity.addShareContent, data: { targetId: groupActivityId, shareContentType: 'groupActivity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
357
-            setShareContentId(data.shareContentId)
358
-            message.info("保存成功")
359
-          }).catch((err) => {
360
-            message.info(err.msg || err.message)
361
-          })
362
-        }
363 332
       } else {
364
-        message.warn("请先保存基本信息数据")
333
+        request({ ...apis.activity.addShareContent, data: { targetId: groupActivityId, shareContentType: 'groupActivity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then(data => {
334
+          setShareContentId(data.shareContentId)
335
+          message.info('保存成功')
336
+        }).catch(err => {
337
+          message.info(err.msg || err.message)
338
+        })
365 339
       }
340
+    } else {
341
+      message.warn('请先保存基本信息数据')
366 342
     }
343
+  }
367 344
 
368
-    return <div style={{ padding: '20px' }}>
369
-      <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
370
-        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享模板</p>
371
-        <div>
372
-          <p style={{ display: 'flex', alignItems: 'center', fontSize: '14px', color: '#999', margin: '0', lineHeight: '0' }}><img src={logo} style={{ width: '22px', marginRight: '10px' }} />橙蕉互动</p>
373
-          <p style={{ fontSize: '16px', color: '#222', fontWeight: '600', margin: '0' }}>{inputValue ? inputValue : '置业V客厅 精准获客平台'}</p>
374
-          <img style={{ width: '200px', height: '160px' }} src={imgValue ? imgValue : poster2} alt="" />
375
-        </div>
376
-      </div>
377
-      <div style={{ display: 'flex', alignItems: 'center', width: '100%' }}>
378
-        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享标题</p>
379
-        <Input placeholder="请输入分享标题" value={inputValue} onChange={e => changeInput(e.target.value)} />
380
-      </div>
381
-      <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
382
-        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>拼团分享图</p>
383
-        <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
345
+  return <div style={{ padding: '20px' }}>
346
+    <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
347
+      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享模板</p>
348
+      <div>
349
+        <p style={{ display: 'flex', alignItems: 'center', fontSize: '14px', color: '#999', margin: '0', lineHeight: '0' }}><img src={logo} style={{ width: '22px', marginRight: '10px' }} />橙蕉互动</p>
350
+        <p style={{ fontSize: '16px', color: '#222', fontWeight: '600', margin: '0' }}>{inputValue || '置业V客厅 精准获客平台'}</p>
351
+        <img style={{ width: '200px', height: '160px' }} src={imgValue || poster2} alt="" />
384 352
       </div>
385
-      <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于拼团活动分享好友</p>
386
-      <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
387
-      <Button onClick={() => cancelPage()}>取消</Button>
388 353
     </div>
354
+    <div style={{ display: 'flex', alignItems: 'center', width: '100%' }}>
355
+      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享标题</p>
356
+      <Input placeholder="请输入分享标题" value={inputValue} onChange={e => changeInput(e.target.value)} />
357
+    </div>
358
+    <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
359
+      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>拼团分享图</p>
360
+      <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
361
+    </div>
362
+    <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于拼团活动分享好友</p>
363
+    <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
364
+    <Button onClick={() => cancelPage()}>取消</Button>
365
+  </div>
366
+}
367
+
368
+
369
+/**
370
+ *
371
+ *
372
+ * @param {*} props
373
+ * @returns
374
+ */
375
+const Edit = props => {
376
+  const [tab, changeTab] = useState('basic')
377
+  // 判断是否展示助力次数的输入框
378
+  const { groupActivityId } = props.location.query
379
+  const [dynamicData, setDynamicData] = useState({ isEnlist: 1 })
380
+  const [scoreData, setScoreData] = useState({})
381
+  const [activityStatus, setActivityStatus] = useState({})
382
+  const [disable, setDisable] = useState(false)
383
+
384
+  // 详情
385
+  const getDynamicData = id => {
386
+    request({ ...apis.groupActivity.details, urlData: { id } }).then(data => {
387
+      setDynamicData(data)
388
+      setActivityStatus(data.activityStatus)
389
+      setDisable(data.activityStatus === 0)
390
+    })
389 391
   }
390 392
 
393
+  useEffect(() => {
394
+    request(apis.groupActivity.avgScore).then(data => {
395
+      setScoreData(data);
396
+    })
397
+  }, [])
398
+
399
+  useEffect(() => {
400
+    if (groupActivityId) {
401
+      getDynamicData(groupActivityId);
402
+    }
403
+  }, [groupActivityId])
404
+
405
+  // const radioOnChange = e => {
406
+  //   setDynamicData({ ...dynamicData, isEnlist: e.target.value })
407
+  // }
408
+
391 409
   return (
392 410
     <div>
393 411
       <div>
@@ -398,14 +416,14 @@ const Edit = props => {
398 416
         </Radio.Group>
399 417
       </div>
400 418
       <div>
401
-        {tab === 'basic' && <Basic />}
402
-        {tab === 'poster' && <Poster />}
419
+        {tab === 'basic' && <Basic dynamicData={dynamicData} disable={disable} activityStatus={activityStatus} scoreData={scoreData} groupActivityId={groupActivityId} />}
420
+        {tab === 'poster' && <Poster groupActivityId={groupActivityId}/>}
403 421
         {tab === 'share' && <Share />}
404 422
       </div>
405 423
       <Prompt message={location =>
406
-        location.pathname.startsWith("/activity/groupActivity")
424
+        (location.pathname.startsWith('/activity/groupActivity')
407 425
           ? true
408
-          : localStorage.removeItem("groupActivePageParams")} />
426
+          : localStorage.removeItem('groupActivePageParams'))} />
409 427
     </div>
410 428
   );
411 429
 }

+ 333
- 309
src/pages/activity/helpActivity/edithelpActivity.jsx Просмотреть файл

@@ -5,7 +5,7 @@ import styles from '../../style/GoodsList.less';
5 5
 import apis from '../../../services/apis';
6 6
 import moment from 'moment';
7 7
 import router from 'umi/router';
8
-import BuildSelect from '../../../components/SelectButton/BuildSelect'
8
+import BuildSelect from '../../../components/SelectButton/BuildSelect2'
9 9
 import XForm, { FieldTypes } from '../../../components/XForm';
10 10
 import Wangedit from '../../../components/Wangedit/Wangedit'
11 11
 import request from '../../../utils/request'
@@ -47,27 +47,27 @@ const header = props => {
47 47
   const [dynamicData, setDynamicData] = useState({ isEnlist: 1 })
48 48
 
49 49
 
50
-      // 详情
51
-      const getDynamicData = helpActivityId => {
52
-        request({ ...apis.helpActivity.details, params: { helpActivityId } }).then((data) => {
53
-          data.activityTime = [moment(data.startDate), moment(data.endDate)]
54
-          const num = data.helpNum > 0 ? 1 : 0
55
-          setIsEnlist(num)
56
-          setActivityStatus(data.activityStatus)
57
-          setDisable(data.activityStatus === 0 ? true : false)
58
-          data.isEnlist = num
59
-          props.form.setFieldsValue(data)
60
-          setDynamicData(data)
61
-        })
62
-      }
50
+  // 详情
51
+  const getDynamicData = helpActivityId => {
52
+    request({ ...apis.helpActivity.details, params: { helpActivityId } }).then((data) => {
53
+      data.activityTime = [moment(data.startDate), moment(data.endDate)]
54
+      const num = data.helpNum > 0 ? 1 : 0
55
+      setIsEnlist(num)
56
+      setActivityStatus(data.activityStatus)
57
+      setDisable(data.activityStatus === 0 ? true : false)
58
+      data.isEnlist = num
59
+      props.form.setFieldsValue(data)
60
+      setDynamicData(data)
61
+    })
62
+  }
63 63
 
64
-    // eslint-disable-next-line react-hooks/rules-of-hooks
65
-    useEffect(() => {
66
-      // eslint-disable-next-line no-use-before-define
67
-      if (helpActivityId) {
68
-        getDynamicData(helpActivityId) 
69
-      }
70
-    }, [])
64
+  // eslint-disable-next-line react-hooks/rules-of-hooks
65
+  useEffect(() => {
66
+    // eslint-disable-next-line no-use-before-define
67
+    if (helpActivityId) {
68
+      getDynamicData(helpActivityId)
69
+    }
70
+  }, [])
71 71
 
72 72
   // function addChannel(params) {
73 73
   //   request({ ...apis.channelList.addChannel, data: { ...params } }).then((data) => {
@@ -78,6 +78,17 @@ const header = props => {
78 78
   // })
79 79
   // }
80 80
 
81
+  function compareDate(dateTime1, dateTime2) {
82
+    var formatDate1 = new Date(dateTime1)
83
+    var formatDate2 = new Date(dateTime2)
84
+    if (formatDate1 > formatDate2) {
85
+      return true;
86
+    }
87
+    else {
88
+      return false;
89
+    }
90
+  }
91
+
81 92
   function handleSubmit(e) {
82 93
     e.preventDefault();
83 94
     props.form.validateFields((err, values) => {
@@ -91,7 +102,7 @@ const header = props => {
91 102
           message.error('助力邀请人数不能超过200')
92 103
           return
93 104
         }
94
-          // 助力邀请人数>0
105
+        // 助力邀请人数>0
95 106
         if (values.personNum <= 0) {
96 107
           message.error('助力邀请人数大于0')
97 108
           return
@@ -99,11 +110,11 @@ const header = props => {
99 110
 
100 111
         // 判断助力人数必须大于0
101 112
         if (values.isEnlist === 1) {
102
-        if (values.helpNum <= 0) {
103
-          message.error('限制助力次数必须大于0')
104
-          return
113
+          if (values.helpNum <= 0) {
114
+            message.error('限制助力次数必须大于0')
115
+            return
116
+          }
105 117
         }
106
-      }
107 118
         const { activityTime, signupTime, ...submitValue } = values
108 119
         const [startDate, endDate] = activityTime
109 120
         console.log('startDate', activityTime)
@@ -114,6 +125,14 @@ const header = props => {
114 125
         // submitValue.enlistEnd = moment(enlistEnd).format('YYYY-MM-DD HH:mm');
115 126
         console.log('submit data --->', submitValue)
116 127
         if (helpActivityId) {
128
+
129
+          const nowDate = new Date()
130
+          if (!compareDate(nowDate, startDate)) {
131
+
132
+            message.info("修改后的开始时间不得大于当前时间(会存在已经成功助力或者发起助力的用户)")
133
+            return
134
+          }
135
+
117 136
           submitValue.helpActivityId = helpActivityId
118 137
           request({ ...apis.helpActivity.update, data: submitValue }).then((data) => {
119 138
             message.info("保存成功")
@@ -145,129 +164,129 @@ const header = props => {
145 164
     <>
146 165
       <Form labelCol={{ span: 7 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
147 166
         <Form.Item label="所属项目">
148
-        {getFieldDecorator('buildingId', {
149
-          rules: [
150
-            {
151
-              required: true,
152
-              message: '请选择所属项目',
153
-            },
154
-          ],
155
-        })(<BuildSelect disabled={disable}/>)}
167
+          {getFieldDecorator('buildingId', {
168
+            rules: [
169
+              {
170
+                required: true,
171
+                message: '请选择所属项目',
172
+              },
173
+            ],
174
+          })(<BuildSelect disabled={disable} />)}
156 175
         </Form.Item>
157 176
 
158 177
         <Form.Item label="活动标题">
159
-        {getFieldDecorator('title', {
160
-          rules: [
161
-            {
162
-              required: true,
163
-              message: '请输入活动标题',
164
-            },
165
-          ],
166
-        })(<Input />)}
178
+          {getFieldDecorator('title', {
179
+            rules: [
180
+              {
181
+                required: true,
182
+                message: '请输入活动标题',
183
+              },
184
+            ],
185
+          })(<Input />)}
167 186
         </Form.Item>
168 187
 
169 188
         <Form.Item label="助力详情主图" help="建议图片尺寸:750*600px,比例5:4,格式:jpg,用于:助力活动详情">
170 189
           {getFieldDecorator('img', {
171
-          rules: [
172
-            {
173
-              required: true,
174
-              message: '助力详情主图不能为空',
175
-            },
176
-          ],
177
-        })(<ImageUploader />)}
190
+            rules: [
191
+              {
192
+                required: true,
193
+                message: '助力详情主图不能为空',
194
+              },
195
+            ],
196
+          })(<ImageUploader />)}
178 197
         </Form.Item>
179 198
 
180 199
         <Form.Item label="助力封面图1" help="建议图片尺寸:750*420px,比例16:9,格式:jpg,用于:活动列表/首页推荐">
181 200
           {getFieldDecorator('listImg', {
182
-          rules: [
183
-            {
184
-              required: true,
185
-              message: '助力封面图1不能为空',
186
-            },
187
-          ],
188
-        })(<ImageUploader />)}
201
+            rules: [
202
+              {
203
+                required: true,
204
+                message: '助力封面图1不能为空',
205
+              },
206
+            ],
207
+          })(<ImageUploader />)}
189 208
         </Form.Item>
190 209
 
191 210
         <Form.Item label="助力封面图2" help="建议图片尺寸:750*250px,比例3:1,格式:jpg,用于:项目详情页">
192 211
           {getFieldDecorator('bannerListImg', {
193
-          rules: [
194
-            {
195
-              required: true,
196
-              message: '助力封面图2不能为空',
197
-            },
198
-          ],
199
-        })(<ImageUploader />)}
212
+            rules: [
213
+              {
214
+                required: true,
215
+                message: '助力封面图2不能为空',
216
+              },
217
+            ],
218
+          })(<ImageUploader />)}
200 219
         </Form.Item>
201 220
 
202 221
         <Form.Item label="活动时间">
203
-        {getFieldDecorator('activityTime', {
204
-          rules: [
205
-            {
206
-              required: true,
207
-              message: '请选择活动时间',
208
-            },
209
-          ],
210
-        })(<RangePicker disabled={activityStatus===0 ? true : false} format="YYYY-MM-DD HH:mm:ss" showTime={{ format: 'HH:mm:ss' }}/>)}
222
+          {getFieldDecorator('activityTime', {
223
+            rules: [
224
+              {
225
+                required: true,
226
+                message: '请选择活动时间',
227
+              },
228
+            ],
229
+          })(<RangePicker format="YYYY-MM-DD HH:mm:ss" showTime={{ format: 'HH:mm:ss' }} />)}
211 230
         </Form.Item>
212 231
 
213 232
         <Form.Item label="助力邀请人数" min={1} max={10}>
214
-        {getFieldDecorator('personNum', {
215
-          rules: [
216
-            {
217
-              required: true,
218
-              message: '请输入活动人数',
219
-            },
220
-          ],
221
-        })(<Input type="number" disabled={activityStatus===0 ? true : false}/>)}
233
+          {getFieldDecorator('personNum', {
234
+            rules: [
235
+              {
236
+                required: true,
237
+                message: '请输入活动人数',
238
+              },
239
+            ],
240
+          })(<Input type="number" disabled={activityStatus === 0 ? true : false} />)}
222 241
         </Form.Item>
223 242
 
224 243
         <Form.Item label="助力次数">
225
-        {getFieldDecorator('isEnlist', {
226
-          rules: [
227
-            {
228
-              required: true,
229
-              message: '请选择助力次数',
230
-            },
231
-          ],
232
-        })(
233
-          <Radio.Group onChange={(e) => radioOnChange(e)} disabled={activityStatus===0 ? true : false}>
234
-            <Radio value={0}>不限制</Radio>
235
-            <Radio value={1}>限制</Radio>
236
-          </Radio.Group>,
237
-        )}
244
+          {getFieldDecorator('isEnlist', {
245
+            rules: [
246
+              {
247
+                required: true,
248
+                message: '请选择助力次数',
249
+              },
250
+            ],
251
+          })(
252
+            <Radio.Group onChange={(e) => radioOnChange(e)} disabled={activityStatus === 0 ? true : false}>
253
+              <Radio value={0}>不限制</Radio>
254
+              <Radio value={1}>限制</Radio>
255
+            </Radio.Group>,
256
+          )}
238 257
         </Form.Item>
239
-         {
240
-           isEnlist === 1 && <Form.Item label=" " min={1} max={10}>
241
-           {getFieldDecorator('helpNum', {
242
-             rules: [
243
-               {
244
-                 required: true,
245
-                 message: '请输入助力人数',
246
-               },
247
-             ],
248
-           })(<Input type="number" placeholder="助力人数限制"/>)}
249
-           </Form.Item>
250
-         }
258
+        {
259
+          isEnlist === 1 && <Form.Item label=" " min={1} max={10}>
260
+            {getFieldDecorator('helpNum', {
261
+              rules: [
262
+                {
263
+                  required: true,
264
+                  message: '请输入助力人数',
265
+                },
266
+              ],
267
+            })(<Input type="number" placeholder="助力人数限制" />)}
268
+          </Form.Item>
269
+        }
251 270
 
252 271
         <Form.Item label="活动说明" help="建议宽度:750px,高度不限,格式:jpg,用于活动详情">
253 272
           {getFieldDecorator('activityInstructions', {
254
-          rules: [
255
-            {
256
-              required: true,
257
-              message: '活动说明不能为空',
258
-            },
259
-          ],
260
-        })(<ImageUploader />)}
261
-        </Form.Item>        
273
+            rules: [
274
+              {
275
+                required: true,
276
+                message: '活动说明不能为空',
277
+              },
278
+            ],
279
+          })(<ImageUploader />)}
280
+        </Form.Item>
262 281
         <Form.Item label="权重">
263
-        {getFieldDecorator('heavy', {
264
-          rules: [
265
-            {
266
-              required: true,
267
-              message: '请输入权重',
268
-            },
269
-          ],
270
-        })(<Input type="number" style={{ width: 80}}/>)}<span style={{ marginLeft: 30, color:'grey'}}>数字越大越靠前</span>
282
+          {getFieldDecorator('heavy', {
283
+            rules: [
284
+              {
285
+                required: true,
286
+                message: '请输入权重',
287
+              },
288
+            ],
289
+          })(<Input type="number" style={{ width: 80 }} />)}<span style={{ marginLeft: 30, color: 'grey' }}>数字越大越靠前</span>
271 290
         </Form.Item>
272 291
         <Form.Item wrapperCol={{ span: 12, offset: 8 }}>
273 292
           <Button type="primary" htmlType="submit">
@@ -277,7 +296,7 @@ const header = props => {
277 296
           <Button onClick={() => cancelPage()}>
278 297
             取消
279 298
           </Button>
280
-          </Form.Item>
299
+        </Form.Item>
281 300
       </Form>
282 301
     </>
283 302
   )
@@ -285,222 +304,227 @@ const header = props => {
285 304
 
286 305
 const Basic = Form.create({ name: 'header' })(header);
287 306
 
288
-/**
289
- *
290
- *
291
- * @param {*} props
292
- * @returns
293
- */
294
-const Edit = props => {
295
-  const [tab, changeTab] = useState('basic')
296
-  // 判断是否展示助力次数的输入框
297
-  // const [help, helpTab] = useState('1')
298
-  const { helpActivityId } = props.location.query
299
-  const [dynamicData, setDynamicData] = useState({ isEnlist: 1 })
300 307
 
301
-    // eslint-disable-next-line react-hooks/rules-of-hooks
302
-    useEffect(() => {
303
-      // eslint-disable-next-line no-use-before-define
304
-      if (helpActivityId) {
305
-      getDynamicData(helpActivityId);
306
-    }
307
-    }, [])
308
+const Poster = props => {
309
+  const { helpActivityId } = props
310
+  const [inputValue, changeInput] = useState('')
311
+  const [textAreaValue, changeTextArea] = useState('')
312
+  const [imgValue, changeImg] = useState('')
313
+  const [posterId, setPosterId] = useState('')
314
+
315
+  useEffect(() => {
316
+    if (helpActivityId) {
317
+      request({ ...apis.activity.poster, params: { targetId: helpActivityId, targetType: 'helpActivity' } }).then(data => {
308 318
 
309
-    // 详情
310
-    const getDynamicData = (helpActivityId) => {
311
-      request({ ...apis.helpActivity.details, params: { helpActivityId } }).then((data) => {
312
-        console.log(data)
313
-        setDynamicData(data)
319
+        if (data.length > 0) {
320
+          setPosterId(data[0].posterId)
321
+          changeImg(data[0].posterImg)
322
+          changeTextArea(data[0].posterDescription)
323
+          changeInput(data[0].posterTitle)
324
+        }
325
+      }).catch(err => {
326
+        message.info(err.msg || err.message)
314 327
       })
315 328
     }
316
-  
317
-  const radioOnChange = e => {
318
-    console.log(e.target.value)
319
-    setDynamicData({ ...dynamicData, isEnlist: e.target.value })
320
-  }
321
-
322
-  const Poster = (props) => {
323
-    const [inputValue, changeInput] = useState('')
324
-    const [textAreaValue, changeTextArea] = useState('')
325
-    const [imgValue, changeImg] = useState('')
326
-    const [posterId, setPosterId] = useState('')
329
+    // getMiniappName()
330
+  }, [])
331
+
332
+  // // 获取小程序名称
333
+  // const [miniappName, setMiniappName] = useState('')
334
+  // function getMiniappName() {
335
+  //   request({ ...apis.building.getMiniappName }).then(res => {
336
+  //     console.log(res, "0000000000000")
337
+  //     setMiniappName(res)
338
+  //   })
339
+  // }
327 340
 
341
+  const submitPoster = () => {
328 342
     if (helpActivityId) {
329
-      console.log(helpActivityId, 'helpActivityId')
330
-      useEffect(() => {
331
-        request({ ...apis.activity.poster, params: { targetId: helpActivityId, targetType: 'helpActivity' } }).then((data) => {
332
-          console.log(data, "2222")
333
-          if (data.length > 0) {
334
-            setPosterId(data[0].posterId)
335
-            changeImg(data[0].posterImg)
336
-            changeTextArea(data[0].posterDescription)
337
-            changeInput(data[0].posterTitle)
338
-          }
339
-        }).catch((err) => {
343
+      if (posterId) {
344
+        request({ ...apis.activity.updatePoster, urlData: { id: posterId }, data: { targetId: helpActivityId, targetType: 'helpActivity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then(data => {
345
+          message.info('保存成功')
346
+        }).catch(err => {
340 347
           message.info(err.msg || err.message)
341 348
         })
342
-        getMiniappName()
343
-      }, [])
344
-    }else{
345
-      getMiniappName()
346
-    }
347
-    // 获取小程序名称
348
-    const [miniappName, setMiniappName] = useState('')
349
-    function getMiniappName() {
350
-      request({ ...apis.building.getMiniappName }).then(res => {
351
-        console.log(res, "0000000000000")
352
-        setMiniappName(res)
353
-      })
354
-    }
355
-
356
-    const submitPoster = () => {
357
-      if (helpActivityId) {
358
-        if (posterId) {
359
-          request({ ...apis.activity.updatePoster, urlData: { id: posterId }, data: { targetId: helpActivityId, targetType: 'helpActivity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
360
-            message.info("保存成功")
361
-          }).catch((err) => {
362
-            message.info(err.msg || err.message)
363
-          })
364
-        } else {
365
-          request({ ...apis.activity.addPoster, data: { targetId: helpActivityId, targetType: 'helpActivity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
366
-            setPosterId(data.posterId)
367
-            message.info("保存成功")
368
-          }).catch((err) => {
369
-            message.info(err.msg || err.message)
370
-          })
371
-        }
372 349
       } else {
373
-        message.warn("请先保存基本信息数据")
350
+        request({ ...apis.activity.addPoster, data: { targetId: helpActivityId, targetType: 'helpActivity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then(data => {
351
+          setPosterId(data.posterId)
352
+          message.info("保存成功")
353
+        }).catch(err => {
354
+          message.info(err.msg || err.message)
355
+        })
374 356
       }
357
+    } else {
358
+      message.warn('请先保存基本信息数据')
375 359
     }
360
+  }
376 361
 
377
-    return <div>
378
-      <div style={{ display: 'flex' }}>
379
-        <div style={{ width: '420px', height: '900px', display: 'inline-block', marginTop: '30px' }}>
380
-          <div style={{ width: '375px', height: '700px', backgroundColor: '#fff', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
381
-            <img style={{ width: '100%', height: '300px' }} src={imgValue ? imgValue : poster1} alt="" />
382
-            <div style={{ display: 'flex', alignItems: 'center', marginTop: '-24px' }}>
383
-              <img style={{ width: '70px', height: '70px', border: '4px solid #fff', borderRadius: '35px', marginLeft: '16px' }} src={touxiang} alt="" />
384
-              <span style={{ color: '#222', fontWeight: '600', margin: '24px 10px 0 14px', fontSize: '17px' }}>喵喵</span>
385
-              <span style={{ color: '#999', marginTop: '25px', fontSize: '17px' }}>邀您参与</span>
386
-              <span style={{ color: '#999', margin: '25px 0 0 60px', fontSize: '17px' }}>2019.09.21</span>
387
-            </div>
388
-            <p style={{
389
-              margin: '10px 20px', fontSize: '20px', color: '#222', fontWeight: '600',
390
-              display: '-webkit-box', lineClamp: '3', height: '60px',
391
-              WebkitLineClamp: '2',
392
-              WebkitBoxOrient: 'vertical',
393
-              overflow: 'hidden',
394
-              textOverflow: 'ellipsis'
395
-            }}>{inputValue ? inputValue : '海报标题'}</p>
396
-
397
-            <img src={yinhao} style={{ width: '30px', marginLeft: '20px' }} alt="" />
398
-            <p style={{
399
-              margin: '16px 20px 28px 20px', fontSize: '17px', color: '#999',
400
-              display: '-webkit-box', lineClamp: '3', height: '72px',
401
-              WebkitLineClamp: '3',
402
-              WebkitBoxOrient: 'vertical',
403
-              overflow: 'hidden',
404
-              textOverflow: 'ellipsis'
405
-            }}>{textAreaValue ? textAreaValue : '海报描述'}</p>
406
-            <div style={{ backgroundColor: '#f1f1f1', padding: '22px 30px', boxShadow: '0px 6px 12px -4px #dcdcdc', position: 'relative' }}>
407
-              <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>长按识别小程序码</p>
408
-              <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>进入活动查看详情</p>
409
-              <img style={{ width: '80px', position: 'absolute', right: '30px', top: '10px' }} src={xiaochengxu} alt="" />
410
-            </div>
411
-          </div>
412
-          <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
413
-        </div>
414
-
415
-        <div >
416
-          <div style={{ display: 'flex', width: '100%', margin: '60px 0' }}>
417
-            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>助力海报图</p>
418
-            <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
362
+  return <div>
363
+    <div style={{ display: 'flex' }}>
364
+      <div style={{ width: '420px', height: '900px', display: 'inline-block', marginTop: '30px' }}>
365
+        <div style={{ width: '375px', height: '700px', backgroundColor: '#fff', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
366
+          <img style={{ width: '100%', height: '300px' }} src={imgValue || poster1} alt="" />
367
+          <div style={{ display: 'flex', alignItems: 'center', marginTop: '-24px' }}>
368
+            <img style={{ width: '70px', height: '70px', border: '4px solid #fff', borderRadius: '35px', marginLeft: '16px' }} src={touxiang} alt="" />
369
+            <span style={{ color: '#222', fontWeight: '600', margin: '24px 10px 0 14px', fontSize: '17px' }}>喵喵</span>
370
+            <span style={{ color: '#999', marginTop: '25px', fontSize: '17px' }}>邀您参与</span>
371
+            <span style={{ color: '#999', margin: '25px 0 0 60px', fontSize: '17px' }}>2019.09.21</span>
419 372
           </div>
420
-          <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于助力活动海报</p>
421
-          <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
422
-            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
423
-            <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
424
-          </div>
425
-          <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
426
-            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报描述</p>
427
-            <TextArea rows={5} maxLength={1024} value={textAreaValue} onChange={e => changeTextArea(e.target.value)} />
373
+          <p style={{
374
+            margin: '10px 20px',
375
+            fontSize: '20px',
376
+            color: '#222',
377
+            fontWeight: '600',
378
+            display: '-webkit-box',
379
+            lineClamp: '3',
380
+            height: '60px',
381
+            WebkitLineClamp: '2',
382
+            WebkitBoxOrient: 'vertical',
383
+            overflow: 'hidden',
384
+            textOverflow: 'ellipsis'
385
+          }}>{inputValue || '海报标题'}</p>
386
+
387
+          <img src={yinhao} style={{ width: '30px', marginLeft: '20px' }} alt="" />
388
+          <p style={{
389
+            margin: '16px 20px 28px 20px',
390
+            fontSize: '17px',
391
+            color: '#999',
392
+            display: '-webkit-box',
393
+            lineClamp: '3',
394
+            height: '72px',
395
+            WebkitLineClamp: '3',
396
+            WebkitBoxOrient: 'vertical',
397
+            overflow: 'hidden',
398
+            textOverflow: 'ellipsis'
399
+          }}>{textAreaValue || '海报描述'}</p>
400
+          <div style={{ backgroundColor: '#f1f1f1', padding: '22px 30px', boxShadow: '0px 6px 12px -4px #dcdcdc', position: 'relative' }}>
401
+            <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>长按识别小程序码</p>
402
+            <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>进入活动查看详情</p>
403
+            <img style={{ width: '80px', position: 'absolute', right: '30px', top: '10px' }} src={xiaochengxu} alt="" />
428 404
           </div>
405
+        </div>
406
+        <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
407
+      </div>
429 408
 
409
+      <div >
410
+        <div style={{ display: 'flex', width: '100%', margin: '60px 0' }}>
411
+          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>助力海报图</p>
412
+          <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
413
+        </div>
414
+        <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px' }}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于助力活动海报</p>
415
+        <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
416
+          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
417
+          <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
430 418
         </div>
419
+        <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
420
+          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报描述</p>
421
+          <TextArea rows={5} maxLength={1024} value={textAreaValue} onChange={e => changeTextArea(e.target.value)} />
422
+        </div>
423
+
431 424
       </div>
432
-      <Button type="primary" onClick={submitPoster} style={{ margin: '40px 40px 40px 30vw' }}> 确定</Button>
433
-      <Button onClick={() => cancelPage()}>取消</Button>
434 425
     </div>
435
-
436
-  }
426
+    <Button type="primary" onClick={submitPoster} style={{ margin: '40px 40px 40px 30vw' }}> 确定</Button>
427
+    <Button onClick={() => cancelPage()}>取消</Button>
428
+  </div>
429
+}
437 430
 
438 431
 
432
+const Share = props => {
433
+  const { helpActivityId } = props
434
+  const [inputValue, changeInput] = useState('')
435
+  const [imgValue, changeImg] = useState('')
436
+  const [shareContentId, setShareContentId] = useState('')
439 437
 
440
-  const Share = (props) => {
441
-    const [inputValue, changeInput] = useState('')
442
-    const [imgValue, changeImg] = useState('')
443
-    const [shareContentId, setShareContentId] = useState('')
438
+  useEffect(() => {
439
+    if (helpActivityId) {
440
+      request({ ...apis.activity.shareContent, params: { targetId: helpActivityId, targetType: 'helpActivity' } }).then(data => {
441
+        if (data.length > 0) {
442
+          setShareContentId(data[0].shareContentId)
443
+          changeImg(data[0].shareContentImg)
444
+          changeInput(data[0].shareContentTitle)
445
+        }
446
+      }).catch(err => {
447
+        message.info(err.msg || err.message)
448
+      })
449
+    }
450
+  }, [])
444 451
 
452
+  const submitShare = () => {
445 453
     if (helpActivityId) {
446
-      useEffect(() => {
447
-        request({ ...apis.activity.shareContent, params: { targetId: helpActivityId, targetType: 'helpActivity' }, }).then((data) => {
448
-          console.log(data, "2222")
449
-          if (data.length > 0) {
450
-            setShareContentId(data[0].shareContentId)
451
-            changeImg(data[0].shareContentImg)
452
-            changeInput(data[0].shareContentTitle)
453
-          }
454
-        }).catch((err) => {
454
+      if (shareContentId) {
455
+        request({ ...apis.activity.updateShareContent, urlData: { id: shareContentId }, data: { targetId: helpActivityId, shareContentType: 'helpActivity', shareContentImg: imgValue, shareContentTitle: inputValue } }).then(data => {
456
+          message.info('保存成功')
457
+        }).catch(err => {
455 458
           message.info(err.msg || err.message)
456 459
         })
457
-      }, [])
458
-    }
459
-
460
-    const submitShare = () => {
461
-      if (helpActivityId) {
462
-        if (shareContentId) {
463
-          request({ ...apis.activity.updateShareContent, urlData: { id: shareContentId }, data: { targetId: helpActivityId, shareContentType: 'helpActivity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
464
-            message.info("保存成功")
465
-          }).catch((err) => {
466
-            message.info(err.msg || err.message)
467
-          })
468
-        } else {
469
-          request({ ...apis.activity.addShareContent, data: { targetId: helpActivityId, shareContentType: 'helpActivity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
470
-            setShareContentId(data.shareContentId)
471
-            message.info("保存成功")
472
-          }).catch((err) => {
473
-            message.info(err.msg || err.message)
474
-          })
475
-        }
476 460
       } else {
477
-        message.warn("请先保存基本信息数据")
461
+        request({ ...apis.activity.addShareContent, data: { targetId: helpActivityId, shareContentType: 'helpActivity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then(data => {
462
+          setShareContentId(data.shareContentId)
463
+          message.info('保存成功')
464
+        }).catch(err => {
465
+          message.info(err.msg || err.message)
466
+        })
478 467
       }
468
+    } else {
469
+      message.warn('请先保存基本信息数据')
479 470
     }
471
+  }
480 472
 
481
-    return <div style={{ padding: '20px' }}>
482
-      <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
483
-        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享模板</p>
484
-        <div>
485
-          <p style={{ display: 'flex', alignItems: 'center', fontSize: '14px', color: '#999', margin: '0', lineHeight: '0' }}><img src={logo} style={{ width: '22px', marginRight: '10px' }} />橙蕉互动</p>
486
-          <p style={{ fontSize: '16px', color: '#222', fontWeight: '600', margin: '0' }}>{inputValue ? inputValue : '置业V客厅 精准获客平台'}</p>
487
-          <img style={{ width: '200px', height: '160px' }} src={imgValue ? imgValue : poster2} alt="" />
488
-        </div>
489
-      </div>
490
-      <div style={{ display: 'flex', alignItems: 'center', width: '100%' }}>
491
-        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享标题</p>
492
-        <Input placeholder="请输入分享标题" value={inputValue} onChange={e => changeInput(e.target.value)} />
493
-      </div>
494
-      <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
495
-        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>助力分享图</p>
496
-        <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
473
+  return <div style={{ padding: '20px' }}>
474
+    <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
475
+      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享模板</p>
476
+      <div>
477
+        <p style={{ display: 'flex', alignItems: 'center', fontSize: '14px', color: '#999', margin: '0', lineHeight: '0' }}>
478
+          <img src={logo} style={{ width: '22px', marginRight: '10px' }} alt="" />橙蕉互动
479
+        </p>
480
+        <p style={{ fontSize: '16px', color: '#222', fontWeight: '600', margin: '0' }}>{inputValue || '置业V客厅 精准获客平台'}</p>
481
+        <img style={{ width: '200px', height: '160px' }} src={imgValue || poster2} alt="" />
497 482
       </div>
498
-      <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于助力活动分享好友</p>
499
-      <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
500
-      <Button onClick={() => cancelPage()}>取消</Button>
501 483
     </div>
484
+    <div style={{ display: 'flex', alignItems: 'center', width: '100%' }}>
485
+      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享标题</p>
486
+      <Input placeholder="请输入分享标题" value={inputValue} onChange={e => changeInput(e.target.value)} />
487
+    </div>
488
+    <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
489
+      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>助力分享图</p>
490
+      <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
491
+    </div>
492
+    <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px' }}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于助力活动分享好友</p>
493
+    <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
494
+    <Button onClick={() => cancelPage()}>取消</Button>
495
+  </div>
496
+}
497
+
498
+
499
+/**
500
+ *
501
+ *
502
+ * @param {*} props
503
+ * @returns
504
+ */
505
+const Edit = props => {
506
+  const [tab, changeTab] = useState('basic')
507
+  // 判断是否展示助力次数的输入框
508
+  // const [help, helpTab] = useState('1')
509
+  const { helpActivityId } = props.location.query
510
+  const [dynamicData, setDynamicData] = useState({ isEnlist: 1 })
511
+  
512
+  // 详情
513
+  const getDynamicData = id => {
514
+    request({ ...apis.helpActivity.details, params: { helpActivityId: id } }).then(data => {
515
+      setDynamicData(data)
516
+    })
502 517
   }
503 518
 
519
+  // eslint-disable-next-line react-hooks/rules-of-hooks
520
+  useEffect(() => {
521
+    // eslint-disable-next-line no-use-before-define
522
+    if (helpActivityId) {
523
+      getDynamicData(helpActivityId);
524
+    }
525
+  }, [])
526
+
527
+
504 528
   return (
505 529
     <div>
506 530
       <div>
@@ -511,14 +535,14 @@ const Edit = props => {
511 535
         </Radio.Group>
512 536
       </div>
513 537
       <div>
514
-        {tab === 'basic' && <Basic helpActivityId={helpActivityId}/>}
515
-        {tab === 'poster' && <Poster />}
516
-        {tab === 'share' && <Share />}
538
+        {tab === 'basic' && <Basic helpActivityId={helpActivityId} />}
539
+        {tab === 'poster' && <Poster helpActivityId={helpActivityId} />}
540
+        {tab === 'share' && <Share helpActivityId={helpActivityId} />}
517 541
       </div>
518 542
       <Prompt message={location =>
519
-        location.pathname.startsWith("/activity/helpActivity")
543
+        (location.pathname.startsWith('/activity/helpActivity')
520 544
           ? true
521
-          : localStorage.removeItem("activePageParams")} />
545
+          : localStorage.removeItem('activePageParams'))} />
522 546
     </div>
523 547
   );
524 548
 }

+ 1
- 0
src/pages/building/list/add/components/base.jsx Просмотреть файл

@@ -434,6 +434,7 @@ function AddBuilding(props) {
434 434
                 <Option value="待售">待售</Option>
435 435
                 <Option value="在售">在售</Option>
436 436
                 <Option value="售罄">售罄</Option>
437
+                <Option value="在租">在租</Option>
437 438
               </Select>,
438 439
             )}
439 440
           </Form.Item>

+ 3
- 1
src/pages/building/list/add/components/buildingProjectType.jsx Просмотреть файл

@@ -98,12 +98,13 @@ class TypeForm extends React.Component {
98 98
                   <Radio.Group onChange={e => this.onChange(e, 'priceType')} >
99 99
                     <Radio value="average">均价</Radio>
100 100
                     <Radio value="total">总价</Radio>
101
+                    <Radio value="lease">租赁价</Radio>
101 102
                   </Radio.Group>
102 103
                 )}
103 104
               </Form.Item>
104 105
             <Form.Item label="价格区间" help='最高价与最低价一致时,只展示一个'>
105 106
               {getFieldDecorator('startPrice')(<Input type="number" placeholder="最低价" style={{width: '120px'}} maxLength="9" onChange={e => this.onChange(e, 'startPrice')} />)} --
106
-              {getFieldDecorator('endPrice')(<Input type="number" placeholder="最高价" style={{width: '120px'}} maxLength="9" onChange={e => this.onChange(e, 'endPrice')} />)}{this.props.type.priceType === "average" ? "元/㎡" : "万元/套"}
107
+              {getFieldDecorator('endPrice')(<Input type="number" placeholder="最高价" style={{width: '120px'}} maxLength="9" onChange={e => this.onChange(e, 'endPrice')} />)}{this.props.type.priceType === "average" ? "元/㎡" : this.props.type.priceType === "lease" ? "元/㎡/天" : "万元/套"}
107 108
             </Form.Item>
108 109
             <Form.Item label="销售状态" >
109 110
             {getFieldDecorator('marketStatus')(
@@ -111,6 +112,7 @@ class TypeForm extends React.Component {
111 112
                 <Option value="待售">待售</Option>
112 113
                 <Option value="在售">在售</Option>
113 114
                 <Option value="售罄">售罄</Option>
115
+                <Option value="在租">在租</Option>
114 116
               </Select>,
115 117
             )}
116 118
           </Form.Item>

+ 4
- 0
src/pages/building/list/add/components/imageSet.jsx Просмотреть файл

@@ -23,6 +23,10 @@ const saleType = [
23 23
     id: 3,
24 24
     name: '在售',
25 25
   },
26
+  {
27
+    id: 4,
28
+    name: '在租',
29
+  },
26 30
 ]
27 31
 
28 32
 const houseType = [

+ 4
- 0
src/pages/building/list/add/components/modalImage.jsx Просмотреть файл

@@ -40,6 +40,10 @@ const saleType = [
40 40
     id: 3,
41 41
     name: '在售',
42 42
   },
43
+  {
44
+    id: 4,
45
+    name: '在租',
46
+  },
43 47
 ]
44 48
 
45 49
 const houseType = [

+ 25
- 5
src/pages/carouselFigure/customImg/edit.jsx Просмотреть файл

@@ -14,9 +14,9 @@ const { TextArea } = Input;
14 14
 const { Option } = Select;
15 15
 
16 16
 let activityVisible = true
17
+let helpTips = ''
17 18
 
18 19
 const setExtraData = (data) => {
19
-    console.log(data, 'data');
20 20
     activityVisible = data.imgType === 'index';
21 21
   }
22 22
 
@@ -36,7 +36,21 @@ const header = props => {
36 36
   } = props;
37 37
 
38 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+' 精准获客平台'})
39
+  const imgType = props.location.query.imgType
40
+
41
+  const [ data, setData ] = useState(imgType === 'index' ? 
42
+  {
43
+    'imgUrl':'https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1574145199853-97feda7895c65be33aa234a7b81b37f.jpg',
44
+    'imgType':'index',
45
+    'imgDesc':'小程序首页分享配图',
46
+    'imgDocument': currentUser.orgName+' 精准获客平台'
47
+  } : 
48
+  {
49
+    'imgUrl':'http://njcj.oss-cn-shanghai.aliyuncs.com/icon.png',
50
+    'imgType':'indexNews',
51
+  }
52
+  )
53
+
40 54
   if(imgId){
41 55
     useEffect(() => {
42 56
       getData(imgId);
@@ -48,8 +62,10 @@ const header = props => {
48 62
         console.log(data)
49 63
         if (data.imgType === 'index'){
50 64
             activityVisible = true;
65
+            helpTips = '建议图片尺寸:750*600px,比例5:4,格式:jpg,用于:首页分享';
51 66
         }else{
52 67
             activityVisible = false;
68
+            helpTips = '建议尺寸:80*80px,比例1:1,格式:jpg,用于:首页资讯logo'
53 69
         }
54 70
         setData(data)
55 71
     })
@@ -62,7 +78,7 @@ const header = props => {
62 78
       name: 'imgUrl',
63 79
       type: FieldTypes.ImageUploader,
64 80
       value: data.imgUrl,
65
-      help: '建议图片尺寸:750*600px,比例5:4,格式:jpg,用于:首页分享',
81
+      help: helpTips,
66 82
       rules: [
67 83
         {required: true, message: '请选择图片'},
68 84
       ]
@@ -71,17 +87,21 @@ const header = props => {
71 87
       label: '类型',
72 88
       name: 'imgType',
73 89
       type: FieldTypes.Select,
74
-      value: 'index',
90
+      value: data.imgType,
75 91
       dict: [{
76 92
           label: '首页分享',
77 93
           value: 'index',
78 94
         },
95
+        {
96
+          label: '首页资讯',
97
+          value: 'indexNews',
98
+        },
79 99
       ],
80 100
       rules: [
81 101
         { required: true, message: '请选择类型' },
82 102
       ],
83 103
     },
84
-    {
104
+    data.imgType === 'index' && {
85 105
       label: '分享文案',
86 106
       name: 'imgDocument',
87 107
       type: FieldTypes.Text,

+ 10
- 6
src/pages/carouselFigure/customImg/list.jsx Просмотреть файл

@@ -26,18 +26,22 @@ function header(props) {
26 26
         if(data.records.length > 0){
27 27
           setData(data.records)
28 28
         }else{
29
-          setData([{'imgUrl':'https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1574145199853-97feda7895c65be33aa234a7b81b37f.jpg','imgType':'index','imgDesc':'小程序首页分享配图'}])
29
+          setData([
30
+            {'imgUrl':'https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1574145199853-97feda7895c65be33aa234a7b81b37f.jpg','imgType':'index','imgDesc':'小程序首页分享配图'},
31
+            {'imgUrl':'http://njcj.oss-cn-shanghai.aliyuncs.com/icon.png','imgType':'indexNews','imgDesc':'首页资讯logo'}
32
+          ])
30 33
         }
31 34
         
32 35
     })
33 36
   }
34 37
   
35 38
     // 跳转到编辑商品
36
-  const toEditCustom = (imgId) => () => {
39
+  const toEditCustom = (imgId, imgType) => () => {
37 40
     router.push({
38 41
       pathname: '/carouselFigure/customImg/edit',
39 42
       query: {
40
-        imgId
43
+        imgId,
44
+        imgType:imgType
41 45
       },
42 46
     });
43 47
   }
@@ -50,12 +54,12 @@ function header(props) {
50 54
       <Table dataSource={data}>
51 55
         <Column title="图片" dataIndex="imgUrl" key="imgUrl" 
52 56
         render={(text, record) => (
53
-        <img src={record.imgUrl} height="120px" width="150px" />
57
+        <img src={record.imgUrl} height="120px" width="150px" style={{ objectFit: 'contain' }}/>
54 58
         )}/>
55 59
         <Column title="类型" dataIndex="imgType" key="imgType" 
56 60
         render={(text, record) => (
57 61
           <span>
58
-            {record.imgType === 'index' ?'首页分享':'请编辑'}
62
+            {record.imgType === 'index' ?'首页分享': record.imgType === 'indexNews' ? '首页资讯' : '请编辑'}
59 63
           </span>
60 64
           )}
61 65
         />
@@ -65,7 +69,7 @@ function header(props) {
65 69
         key="handle" 
66 70
         render={(text, record) => (
67 71
           <AuthButton name="admin.custom.put" noRight={null}>
68
-            <span style={{ color: '#FF925C', cursor: 'pointer' }} onClick={toEditCustom(record.imgId)}>
72
+            <span style={{ color: '#FF925C', cursor: 'pointer' }} onClick={toEditCustom(record.imgId, record.imgType)}>
69 73
               编辑<Icon type="form" className={styles.edit} />
70 74
             </span>
71 75
           </AuthButton>

+ 1
- 1
src/pages/carouselFigure/editAdvertising.jsx Просмотреть файл

@@ -4,7 +4,7 @@ import { FormattedMessage } from 'umi-plugin-react/locale';
4 4
 import styles from '../style/GoodsList.less';
5 5
 import moment from 'moment';
6 6
 import router from 'umi/router';
7
-import BuildSelect from '../../components/SelectButton/BuildSelect'
7
+import BuildSelect from '../../components/SelectButton/BuildSelect2'
8 8
 import CitySelect from '../../components/SelectButton/CitySelect2'
9 9
 import { FieldTypes, createForm } from '../../components/XForm';
10 10
 import Wangedit from '../../components/Wangedit/Wangedit';

+ 1
- 1
src/pages/carouselFigure/editCarousel.jsx Просмотреть файл

@@ -4,7 +4,7 @@ import { FormattedMessage } from 'umi-plugin-react/locale';
4 4
 import moment from 'moment';
5 5
 import router from 'umi/router';
6 6
 import styles from '../style/GoodsList.less';
7
-import BuildSelect from '../../components/SelectButton/BuildSelect'
7
+import BuildSelect from '../../components/SelectButton/BuildSelect2'
8 8
 import CitySelect from '../../components/SelectButton/CitySelect2'
9 9
 import { createForm, FieldTypes } from '../../components/XForm';
10 10
 import Wangedit from '../../components/Wangedit/Wangedit'

+ 1
- 1
src/pages/carouselFigure/propaganda.jsx Просмотреть файл

@@ -4,7 +4,7 @@ import { FormattedMessage } from 'umi-plugin-react/locale';
4 4
 import styles from '../style/GoodsList.less';
5 5
 import moment from 'moment';
6 6
 import router from 'umi/router';
7
-import BuildSelect from '../../components/SelectButton/BuildSelect'
7
+import BuildSelect from '../../components/SelectButton/BuildSelect2'
8 8
 import CitySelect from '../../components/SelectButton/CitySelect2'
9 9
 import { FieldTypes, createForm } from '../../components/XForm';
10 10
 import Wangedit from '../../components/Wangedit/Wangedit';

+ 8
- 7
src/pages/channel/brokerList.jsx Просмотреть файл

@@ -1,5 +1,5 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Input, Menu, Dropdown, Button, Icon, message, Table, Divider, Tag, Select, Form } from 'antd';
2
+import { Input, Menu, Dropdown, Button, Icon, message, Table, Divider, Tag, Select, Form, Avatar } from 'antd';
3 3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4 4
 import channels from './channelList.less';
5 5
 import router from 'umi/router';
@@ -36,18 +36,19 @@ const columns = [
36 36
     align: 'center',
37 37
 
38 38
     // eslint-disable-next-line jsx-a11y/alt-text
39
-    render: (text, list) => <img src={list.avatarurl }/>,
39
+    render: (text, list) => <Avatar shape="square" style={{ color: 'blue', cursor: 'pointer' }} src={list.avatarurl} size={64} icon="user" />,
40 40
   },
41 41
   {
42 42
     title: '用户姓名',
43
-    dataIndex: 'name',
44
-    key: 'name',
43
+    dataIndex: 'nickname',
44
+    key: 'nickname',
45 45
     align: 'center',
46
+    render: (text, list) => <><span>{ list.name || list.nickname }</span></>,
46 47
   },
47 48
   {
48 49
     title: '电话',
49
-    dataIndex: 'tel',
50
-    key: 'tel',
50
+    dataIndex: 'phone',
51
+    key: 'phone',
51 52
     align: 'center',
52 53
   },
53 54
   {
@@ -55,7 +56,7 @@ const columns = [
55 56
     dataIndex: 'sex',
56 57
     key: 'sex',
57 58
     align: 'center',
58
-    render: (text, list) => <a>{list.gender === '1' ? '男' : '女'}</a>,
59
+    render: (text, list) => <a>{list.gender === '1' ? '男' : list.gender === '2' ? '女':'未知'}</a>,
59 60
   },
60 61
   {
61 62
     title: '推荐客户',

+ 26
- 14
src/pages/channel/channelList.jsx Просмотреть файл

@@ -6,6 +6,7 @@ import router from 'umi/router';
6 6
 import apis from '../../services/apis';
7 7
 import request from '../../utils/request';
8 8
 import AuthButton from '@/components/AuthButton';
9
+import ChannelSelect from '@/components/SelectButton/channelSelect';
9 10
 
10 11
 const { Option } = Select;
11 12
 
@@ -67,7 +68,7 @@ const columns = [
67 68
       render: (text, record) => <a style={ { color: '#66B3FF' } } onClick= {() => toBroker(record)} >{ record.brokerCount }</a>,
68 69
   },
69 70
   {
70
-    title: '推荐客户有效',
71
+    title: '推荐客户有效',
71 72
     dataIndex: 'recommendCount',
72 73
     key: 'recommendCount',
73 74
     align: 'center',
@@ -107,9 +108,9 @@ function toedit(channelId) {
107 108
 
108 109
 // 经纪人页面
109 110
 function toBroker(record) {
110
-  if (record.brokerCount === 0) {
111
-    return
112
-  }
111
+  // if (record.brokerCount === 0) {
112
+  //   return
113
+  // }
113 114
   router.push({
114 115
     pathname: '/channel/brokerList',
115 116
     query: {
@@ -121,6 +122,7 @@ function toBroker(record) {
121 122
 const header = props => {
122 123
   // eslint-disable-next-line react-hooks/rules-of-hooks
123 124
   const [data, setData] = useState({ channelNmae: [], result: [] })
125
+  const [channelNmae, setChannelNmae] = useState()
124 126
   // eslint-disable-next-line react-hooks/rules-of-hooks
125 127
   useEffect(() => {
126 128
     localStorage.removeItem('value');
@@ -142,10 +144,12 @@ const header = props => {
142 144
   }
143 145
   // 查询
144 146
   function queryList() {
145
-    getList({ pageNum: 1, pageSize: 10, channelId: localStorage.getItem('value') })
147
+   
148
+    getList({ pageNum: 1, pageSize: 10, channelId: channelNmae })
146 149
   }
147 150
   // 重置
148 151
   function reset() {
152
+    setChannelNmae()
149 153
     getList({ pageNum: 1, pageSize: 10 })
150 154
   }
151 155
 
@@ -161,31 +165,39 @@ const header = props => {
161 165
 
162 166
   // 分页
163 167
   function onChange(pageNumber) {
164
-    props.form.validateFields((err, values) => {
165
-      if (!err) {
166
-        getList({ pageNum: pageNumber, pageSize: 10, ...values })
167
-      }
168
-    });
168
+    getList({ pageNum: pageNumber, pageSize: 10, channelId: channelNmae })
169
+    // getList({ pageNum: pageNumber, pageSize: 10, ...values })
170
+    // props.form.validateFields((err, values) => {
171
+    //   if (!err) {
172
+    //     getList({ pageNum: pageNumber, pageSize: 10, ...values })
173
+    //   }
174
+    // });
175
+  }
176
+
177
+  function onChannelChange(value) {
178
+    setChannelNmae(value)
169 179
   }
170 180
 
171 181
   return (
172 182
     <>
173 183
       <div className={channels.searchBox}>
174 184
         <div>
175
-          <span className={channels.selectName}>渠道名称</span>
185
+        <span className={channels.selectName}>渠道名称</span>
186
+        <ChannelSelect value={channelNmae} onChange={onChannelChange}></ChannelSelect>
187
+          {/* 
176 188
           <Select defaultValue="请选择" style={{ width: 180 }} onChange={handleChange}>
177 189
             <option value="">全部</option>
178 190
             {data.channelNmae.map(Item =>
179 191
               <Option value={Item.channelId}> {Item.channelName} </Option>,
180
-            )}
192
+            )} */}
181 193
             {/* {listItems} */}
182
-          </Select>
194
+          {/* </Select> */}
183 195
         </div>
184 196
         <div >
185 197
         <AuthButton name="admin.channel.search" noRight={null}>
186 198
           <Button type="primary" onClick={() => queryList()}>查询</Button>
187 199
           </AuthButton>
188
-          {/* <Button onClick={() => reset() }>重置</Button> */}
200
+          <Button onClick={() => reset() } style={{marginLeft:'8px'}}>重置</Button>
189 201
         </div>
190 202
       </div>
191 203
       <AuthButton name="admin.channel.post" noRight={null}>

+ 94
- 48
src/pages/channel/independentList/index.jsx Просмотреть файл

@@ -6,7 +6,7 @@ import apis from '../../../services/apis';
6 6
 import Styles from './style.less';
7 7
 import { router } from 'umi';
8 8
 import AuthButton from '@/components/AuthButton';
9
-
9
+import ChannelSelect from '@/components/SelectButton/channelSelect';
10 10
 
11 11
 const { Option } = Select;
12 12
 // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -24,11 +24,11 @@ class ModalTable extends React.Component {
24 24
   }
25 25
 
26 26
   // 挂载之后
27
-  componentDidMount () {
27
+  componentDidMount() {
28 28
     this.getList({ pageNumber: 1, pageSize: 5 })
29 29
   }
30 30
 
31
-  componentDidUpdate (preProps, preState) {
31
+  componentDidUpdate(preProps, preState) {
32 32
     if (this.props.visibleData.customerId !== preState.visibleData.customerId) {
33 33
       this.getList({ pageNumber: 1, pageSize: 5 })
34 34
       this.setState({ visibleData: this.props.visibleData });
@@ -37,16 +37,17 @@ class ModalTable extends React.Component {
37 37
 
38 38
   // 弹框确定按钮
39 39
   // eslint-disable-next-line react/sort-comp
40
-  handleOk () {
40
+  handleOk() {
41 41
     this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
42 42
   }
43 43
 
44 44
   // 弹框取消按钮
45
-  handleCancel () {
45
+  handleCancel() {
46 46
     this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
47 47
   }
48 48
 
49
-  getList (params) {
49
+  getList(params) {
50
+    // eslint-disable-next-line no-console
50 51
     console.log('this.state.visibleData', this.state.visibleData)
51 52
     const { customerId } = this.state.visibleData
52 53
     if (customerId === '' || customerId === undefined) {
@@ -70,25 +71,25 @@ class ModalTable extends React.Component {
70 71
   }
71 72
 
72 73
   // 分页
73
-  onChange (pageNum) {
74
-    props.form.validateFields((err, values) => {
75
-      if (!err) {
76
-        getList({ pageNumber: pageNum, pageSize: 5, ...values })
77
-      }
78
-    });
74
+  onChange(pageNum) {
75
+
76
+    this.getList({ pageNumber: pageNum, pageSize: 5, })
77
+
79 78
   }
80 79
 
81
-  render () {
80
+  render() {
82 81
     const columns = [
83 82
       {
84 83
         title: '头像',
85 84
         // eslint-disable-next-line jsx-a11y/alt-text
86
-        render: (text, records) => <img src={records.picture} width={50} height={50} />,
85
+        render: (text, record) => <Avatar shape="square" src={record.picture} size={64} icon="user" />,
86
+        // render: (text, records) => <img src={records.picture} width={50} height={50} />,
87 87
       },
88 88
       {
89 89
         title: '用户名',
90 90
         dataIndex: 'name',
91 91
         key: 'name',
92
+        // render: (row) => <><span>{console.log(row, 'row')}{row.name || row.nickname}</span></>,
92 93
       },
93 94
       {
94 95
         title: '电话',
@@ -110,20 +111,37 @@ class ModalTable extends React.Component {
110 111
         title: '推荐时间',
111 112
         dataIndex: 'createDate',
112 113
         key: 'createDate',
113
-        render: (_, record) => <><span>{ record.createDate && moment(record.createDate).format('YYYY-MM-DD') }</span></>,
114
+        render: (_, record) => <><span>{record.createDate && moment(record.createDate).format('YYYY-MM-DD HH:mm:ss')}</span></>,
114 115
       },
115 116
       {
116 117
         title: '状态',
117 118
         // eslint-disable-next-line consistent-return
118 119
         render: (text, records) => {
119 120
           console.log("retrun", records)
120
-          if (records.status === 1) { if(records.reportRecommendStatus === 1) {return '报备'} if(records.reportRecommendStatus === 2) {return '推荐'}  }
121
+          //     if (records.status === 1) { return '报备' }
122
+          // if (records.status === 2) { return '推荐' }
123
+          // if (records.status === 3) { return '认购' }
124
+          // if (records.status === 4) { return '签约' }
125
+          // if (records.verifyStatus === 1) { return '待审核' }
126
+          // if (records.verifyStatus === 2) { return '审核同意' }
127
+          // if (records.verifyStatus === 3) { return '签约' }
128
+          // if (records.status === 1) { if(records.reportRecommendStatus === 1) {return '报备'} if(records.reportRecommendStatus === 2) {return '推荐'}  }
129
+          // if (records.status === 2) { return '到访' }
130
+          // if (records.status === 3) { return '认购' }
131
+          // if (records.status === 4) { return '签约' }
132
+          // if (records.verifyStatus === 1) { return '待审核' }
133
+          // if (records.verifyStatus === 2) { return '审核同意' }
134
+          // if (records.verifyStatus === 3) { return '签约' }
135
+          if (records.status === 1) {
136
+            if (records.verifyStatus === 0) { return '待审核' }
137
+            if (records.verifyStatus === 1) { return '报备' }
138
+            // if (records.reportRecommendStatus === 1) { return '报备' }
139
+            // if (records.reportRecommendStatus === 2) { return '推荐' }}
140
+            if (records.verifyStatus === 2) { return '审核驳回' }
141
+           }
121 142
           if (records.status === 2) { return '到访' }
122 143
           if (records.status === 3) { return '认购' }
123 144
           if (records.status === 4) { return '签约' }
124
-          if (records.verifyStatus === 1) { return '待审核' }
125
-          if (records.verifyStatus === 2) { return '审核同意' }
126
-          if (records.verifyStatus === 3) { return '签约' }
127 145
           // reportRecommendStatus
128 146
         },
129 147
       },
@@ -139,13 +157,13 @@ class ModalTable extends React.Component {
139 157
           // onOk={() => this.handleOk()}
140 158
           onCancel={(e) => this.handleCancel(e)}
141 159
         >
142
-          <Table rowKey="independentList" dataSource={this.state.dataSource.records} columns={columns} pagination={{ total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
160
+          <Table rowKey="independentList" dataSource={this.state.dataSource.records} columns={columns} pagination={{ current: this.state.dataSource.current, pageSize: this.state.dataSource.size, total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
143 161
         </Modal>
144 162
       </>
145 163
     );
146 164
   }
147 165
 }
148
-
166
+// defaultCurrent={1} total={dataSource.total} pageSize={6} onChange={onChange} current={dataSource.current}
149 167
 
150 168
 /**
151 169
  * 邀请客户
@@ -160,13 +178,13 @@ class InviteTable extends React.Component {
160 178
   }
161 179
 
162 180
   // 挂载之后
163
-  componentDidMount () {
164
-    
181
+  componentDidMount() {
182
+
165 183
   }
166 184
 
167
-  componentDidUpdate (preProps, preState) {
185
+  componentDidUpdate(preProps, preState) {
168 186
     const { customerId } = this.props.visibleData
169
-    
187
+
170 188
     if (this.props.visibleData.visible !== preState.visibleData.visible) {
171 189
       this.getList({ id: customerId, pageNumber: 1, pageSize: 5 })
172 190
       this.setState({ visibleData: this.props.visibleData });
@@ -175,18 +193,18 @@ class InviteTable extends React.Component {
175 193
 
176 194
   // 弹框确定按钮
177 195
   // eslint-disable-next-line react/sort-comp
178
-  handleOk () {
196
+  handleOk() {
179 197
     this.setState({ dataSource: { records: [] } })
180 198
     this.props.onCancel()
181 199
   }
182 200
 
183 201
   // 弹框取消按钮
184
-  handleCancel () {
202
+  handleCancel() {
185 203
     this.setState({ dataSource: { records: [] } })
186 204
     this.props.onCancel()
187 205
   }
188 206
 
189
-  getList (params) {
207
+  getList(params) {
190 208
     const { id } = params
191 209
     console.log(id)
192 210
     if (id === '' || id === undefined) {
@@ -196,16 +214,16 @@ class InviteTable extends React.Component {
196 214
       this.setState({ dataSource: res })
197 215
     }).catch(err => {
198 216
       // eslint-disable-next-line no-unused-expressions
199
-    
217
+
200 218
     })
201 219
   }
202 220
 
203 221
   // 分页
204
-  onChange (pageNum) {
222
+  onChange(pageNum) {
205 223
     this.getList({ pageNumber: pageNum, pageSize: 5 })
206 224
   }
207 225
 
208
-  render () {
226
+  render() {
209 227
     const columns = [
210 228
       {
211 229
         title: '头像',
@@ -219,7 +237,7 @@ class InviteTable extends React.Component {
219 237
         dataIndex: 'nickname',
220 238
         key: 'nickname',
221 239
         align: 'center',
222
-        render: text => <a>{text}</a>,
240
+        render: (row) => <><span>{console.log(row, 'row')}{row.name || row.nickname}</span></>,
223 241
       },
224 242
       {
225 243
         title: '电话',
@@ -259,8 +277,8 @@ class InviteTable extends React.Component {
259 277
  * @param {*} props
260 278
  * @returns
261 279
  */
262
-function body (props) {
263
-  const { getFieldDecorator } = props.form
280
+function body(props) {
281
+  const { getFieldDecorator, getFieldsValue } = props.form
264 282
 
265 283
   // eslint-disable-next-line react-hooks/rules-of-hooks
266 284
   const [dataSource, setDataSource] = useState({ records: [] })
@@ -271,7 +289,7 @@ function body (props) {
271 289
   }, [])
272 290
 
273 291
 
274
-  function openNotificationWithIcon (type, message) {
292
+  function openNotificationWithIcon(type, message) {
275 293
     notification[type]({
276 294
       message,
277 295
       description:
@@ -279,7 +297,7 @@ function body (props) {
279 297
     });
280 298
   }
281 299
 
282
-  function getList (params) {
300
+  function getList(params) {
283 301
     // 网路请求
284 302
     request({ ...apis.customer.agents, params: { ...params } }).then(res => {
285 303
       setDataSource(res)
@@ -289,7 +307,7 @@ function body (props) {
289 307
   }
290 308
 
291 309
   // 提交事件
292
-  function handleSubmit (e) {
310
+  function handleSubmit(e) {
293 311
     e.preventDefault();
294 312
     props.form.validateFields((err, values) => {
295 313
       if (!err) {
@@ -302,24 +320,24 @@ function body (props) {
302 320
   // eslint-disable-next-line react-hooks/rules-of-hooks
303 321
   const [gInviteData, setGInviteData] = useState({ visible: false, customerId: '', realtyConsultant: '' })
304 322
   // Change 事件
305
-  function handleSelectChange (e) {
323
+  function handleSelectChange(e) {
306 324
     // eslint-disable-next-line no-console
307 325
     console.log(e)
308 326
   }
309
-  function gM (row) {
327
+  function gM(row) {
310 328
     setGVisibleData({ visible: true, customerId: row.personId, realtyConsultant: row.realtyConsultant })
311 329
 
312 330
     setGInviteData({ visible: false })
313 331
   }
314 332
 
315
-  function Invite (row) {
333
+  function Invite(row) {
316 334
     setGInviteData({ visible: true, customerId: row.personId, realtyConsultant: row.realtyConsultant })
317 335
 
318 336
     setGVisibleData({ visible: false })
319 337
   }
320 338
 
321 339
   // 分页
322
-  function onChange (pageNum) {
340
+  function onChange(pageNum) {
323 341
     // eslint-disable-next-line react-hooks/rules-of-hooks
324 342
     getList({ pageNumber: pageNum, pageSize: 10 })
325 343
   }
@@ -327,11 +345,12 @@ function body (props) {
327 345
   /**
328 346
     * 重置搜索
329 347
     */
330
-  function handleReset () {
348
+  function handleReset() {
331 349
     props.form.resetFields();
350
+    getList({ pageNumber: 1, pageSize: 10 })
332 351
   }
333 352
 
334
-  function toAudit (cuurentId) {
353
+  function toAudit(cuurentId) {
335 354
     router.push({
336 355
       pathname: '/customer/recommendCustomer/audit',
337 356
       query: {
@@ -340,8 +359,10 @@ function body (props) {
340 359
     })
341 360
   }
342 361
 
343
-  function exportIndependen () {
344
-    request({ ...apis.customer.customerRecommendAgentsExport, responseType: 'blob' })
362
+  function exportIndependen() {
363
+    const fieldsValue = getFieldsValue()
364
+    console.log('fieldsValue', fieldsValue)
365
+    request({ ...apis.customer.customerRecommendAgentsExport, responseType: 'blob', params: { ...fieldsValue } })
345 366
       .then(response => {
346 367
         download(response)
347 368
       }).catch(error => {
@@ -349,7 +370,7 @@ function body (props) {
349 370
       })
350 371
   }
351 372
 
352
-  function download (data) {
373
+  function download(data) {
353 374
     if (!data) {
354 375
       return
355 376
     }
@@ -373,6 +394,7 @@ function body (props) {
373 394
       title: '姓名',
374 395
       dataIndex: 'nickname',
375 396
       key: 'nickname',
397
+      render: (_, record) => <><span>{record.name || record.nickname}</span></>,
376 398
     },
377 399
     {
378 400
       title: '电话',
@@ -390,13 +412,13 @@ function body (props) {
390 412
       title: '类型',
391 413
       dataIndex: 'personType',
392 414
       key: 'personType',
393
-      render: (_, record) => <><span>{record.personType === 'channel agent' ? '渠道经纪人' : '独立经纪人'}</span></>,
415
+      render: (_, record) => <><span>{record.personType === 'channel agent' ? '专业经纪人' : '专业经纪人'}</span></>,
394 416
     },
395 417
     {
396 418
       title: '所属渠道',
397 419
       dataIndex: 'channelName',
398 420
       key: 'channelName',
399
-      render: (_, record) => <><span>{record.personType === 'channel agent' ? record.channelName : ''}</span></>,
421
+      render: (_, record) => <><span>{record.channelName}</span></>,
400 422
     },
401 423
     {
402 424
       title: '操作',
@@ -421,9 +443,33 @@ function body (props) {
421 443
     },
422 444
   ]
423 445
 
446
+  // <div>
447
+  //         <span className={channels.selectName}>渠道名称</span>
448
+  //         <Select defaultValue="请选择" style={{ width: 180 }} onChange={handleChange}>
449
+  //           <option value="">全部</option>
450
+  //           {data.channelNmae.map(Item =>
451
+  //             <Option value={Item.channelId}> {Item.channelName} </Option>,
452
+  //           )}
453
+  //           {/* {listItems} */}
454
+  //         </Select>
455
+  //       </div>
456
+  //       <div ></div>
457
+
424 458
   return (
425 459
     <>
426 460
       <Form layout="inline" onSubmit={e => handleSubmit(e, props)} style={{ display: 'flex', alignItems: 'center' }}>
461
+        <Form.Item>
462
+          {getFieldDecorator('channelId')(
463
+            <ChannelSelect />
464
+            //   <Select defaultValue="渠道名称" style={{ width: 180 }} onChange={handleChange}>
465
+            //   <option value="">全部</option>
466
+            //   {data.channelNmae.map(Item =>
467
+            //     <Option value={Item.channelId}> {Item.channelName} </Option>,
468
+            //   )}
469
+
470
+            // </Select>,
471
+          )}
472
+        </Form.Item>
427 473
         <Form.Item>
428 474
           {getFieldDecorator('name')(
429 475
             <Input

+ 41
- 24
src/pages/channel/recommendClients.jsx Просмотреть файл

@@ -1,5 +1,5 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Input, Menu, Dropdown, Button, Icon, message, Table, Divider, Tag, Select } from 'antd';
2
+import { Input, Menu, Dropdown, Button, Icon, message, Table, Divider, Tag, Select, Avatar } from 'antd';
3 3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4 4
 import channels from './channelList.less';
5 5
 import router from 'umi/router';
@@ -52,14 +52,14 @@ const columns = [
52 52
     // key: 'img',
53 53
     align: 'center',
54 54
 
55
-    render: (text, record) => <img src={record.picture} className={channels.touxiang} />,
55
+    render: (text, record) => <Avatar shape="square" src={record.picture} size={64} icon="user" />,
56 56
   },
57 57
   {
58 58
     title: '用户姓名',
59 59
     dataIndex: 'name',
60 60
     key: 'name',
61 61
     align: 'center',
62
-    render: text => <a>{text}</a>,
62
+    render: (text, record) => <div>{record.name}</div>,
63 63
   },
64 64
   {
65 65
     title: '电话',
@@ -72,7 +72,7 @@ const columns = [
72 72
     dataIndex: 'sex',
73 73
     key: 'sex',
74 74
     align: 'center',
75
-    render: (text, record) => <a style={ { color: '#66B3FF' } } >{ record.sex === 1 ? '男' : '女' }</a>,
75
+    render: (text, record) => <span>{record.sex === 1 ? '男' : record.sex === 2 ? '女' : '未知'}</span>
76 76
   },
77 77
   {
78 78
     title: '意向项目',
@@ -85,7 +85,7 @@ const columns = [
85 85
     dataIndex: 'createDate',
86 86
     key: 'createDate',
87 87
     align: 'center',
88
-    render: (_, record) => <><span>{ record.createDate && moment(record.createDate).format('YYYY-MM-DD') }</span></>,
88
+    render: (_, record) => <><span>{record.createDate && moment(record.createDate).format('YYYY-MM-DD HH:mm:ss')}</span></>,
89 89
   },
90 90
   {
91 91
     title: '状态',
@@ -94,21 +94,38 @@ const columns = [
94 94
     align: 'center',
95 95
     // eslint-disable-next-line consistent-return
96 96
     render: (text, records) => {
97
-      if (records.status === 1) { return '报备' }
98
-      if (records.status === 2) { return '推荐' }
97
+      //    if (records.status === 1) { if(records.reportRecommendStatus === 0) {return '未审核'} if(records.reportRecommendStatus === 1) {return '报备'} if(records.reportRecommendStatus === 2) {return '推荐'}  }
98
+      // if (records.status === 2) { return '到访' }
99
+      // if (records.status === 3) { return '认购' }
100
+      // if (records.status === 4) { return '签约' }
101
+      // if (records.verifyStatus === 1) { return '待审核' }
102
+      // if (records.verifyStatus === 2) { return '审核同意' }
103
+      // if (records.verifyStatus === 3) { return '签约' }
104
+      // if (records.status === 1) { return '报备' }
105
+      // if (records.status === 2) { return '推荐' }
106
+      // if (records.status === 3) { return '认购' }
107
+      // if (records.status === 4) { return '签约' }
108
+      // if (records.verifyStatus === 1) { return '待审核' }
109
+      // if (records.verifyStatus === 2) { return '审核同意' }
110
+      // if (records.verifyStatus === 3) { return '签约' }
111
+      if (records.status === 1) {
112
+        if (records.verifyStatus === 0) { return '待审核' }
113
+        if (records.verifyStatus === 1) { return '报备' }
114
+        // if (records.reportRecommendStatus === 1) { return '报备' }
115
+        // if (records.reportRecommendStatus === 2) { return '推荐' }}
116
+        if (records.verifyStatus === 2) { return '审核驳回' }
117
+       }
118
+      if (records.status === 2) { return '到访' }
99 119
       if (records.status === 3) { return '认购' }
100 120
       if (records.status === 4) { return '签约' }
101
-      if (records.verifyStatus === 1) { return '待审核' }
102
-      if (records.verifyStatus === 2) { return '审核同意' }
103
-      if (records.verifyStatus === 3) { return '签约' }
104
-    },
121
+    }
105 122
   },
106 123
 ];
107 124
 
108 125
 const header = props => {
109 126
   // eslint-disable-next-line react-hooks/rules-of-hooks
110 127
   const [data, setData] = useState({})
111
-//   const [page, changePage] = useState({})
128
+  //   const [page, changePage] = useState({})
112 129
   // eslint-disable-next-line react-hooks/rules-of-hooks
113 130
   useEffect(() => {
114 131
     getListRecommend({ pageNumber: 1, pageSize: 10 })
@@ -129,23 +146,23 @@ const header = props => {
129 146
   function getListRecommend(params) {
130 147
     request({ ...apis.channelList.getListRecommend, urlData: { id: props.location.query.id }, params: { ...params } }).then((data) => {
131 148
       setData(data)
132
-  }).catch((err) => {
149
+    }).catch((err) => {
133 150
       console.log(err)
134 151
       message.info(err.msg || err.message)
135
-  })
152
+    })
136 153
   }
137 154
 
138 155
 
139
-   // 分页
140
- function onChange(pageNum) {
141
-      // eslint-disable-next-line react-hooks/rules-of-hooks
142
-      getListRecommend({ pageNumber: pageNum, pageSize: 9 })
143
-    }
144
-return (
145
-  <>
146
-  <Table dataSource={data.records} rowKey="recommendClist" columns={columns} pagination={{ pageSize: 10, total: data.total, onChange }} />
147
-  </>
148
-)
156
+  // 分页
157
+  function onChange(pageNum) {
158
+    // eslint-disable-next-line react-hooks/rules-of-hooks
159
+    getListRecommend({ pageNumber: pageNum, pageSize: 10 })
160
+  }
161
+  return (
162
+    <>
163
+      <Table dataSource={data.records} rowKey="recommendClist" columns={columns} pagination={{ pageSize: 10, total: data.total, onChange }} />
164
+    </>
165
+  )
149 166
 }
150 167
 
151 168
 function handleMenuClick(e) {

+ 34
- 25
src/pages/customer/customerlist/components/BatchAssistConsultant.jsx Просмотреть файл

@@ -22,8 +22,9 @@ class ModalAttribution extends React.Component {
22 22
     super(props);
23 23
     console.log(props, 'props')
24 24
     this.state = {
25
-       dataSource: { records: [] },
26
-       visibleData: { visible: false, customerId: [], buildingName: '' },
25
+      dataSource: { records: [] },
26
+      visibleData: { visible: false, customerId: [], buildingName: '' },
27
+      buildingId: ''
27 28
     }
28 29
   }
29 30
 
@@ -33,9 +34,11 @@ class ModalAttribution extends React.Component {
33 34
   }
34 35
 
35 36
   componentDidUpdate(preProps, preState) {
37
+    // this.setState({ buildingId: this.props.visibleData.buildingId })
36 38
     console.log(this.props.visibleData)
37 39
     if (this.props.visibleData.visible !== preState.visibleData.visible) {
38
-      this.getList({ pageNumber: 1, pageSize: 5, customerId: this.props.visibleData.customerId })
40
+
41
+      this.getList({ pageNumber: 1, pageSize: 5, buildingId: this.props.visibleData.buildingId })
39 42
       this.setState({ visibleData: this.props.visibleData });
40 43
     }
41 44
   }
@@ -51,12 +54,12 @@ class ModalAttribution extends React.Component {
51 54
     this.props.onCancel()
52 55
   }
53 56
 
54
-  changBuilding(buildingId){
57
+  changBuilding(buildingId) {
55 58
     this.getUserList({ pageNumber: 1, pageSize: 5, buildingId: buildingId })
56 59
     this.setState({ visibleData: { visible: this.props.visibleData.visible, customerId: this.props.visibleData.customerId, buildingName: buildingId } });
57 60
   }
58 61
 
59
-  getUserList(params){
62
+  getUserList(params) {
60 63
     console.log('params: ', params)
61 64
     if (params.buildingId === '' || params.buildingId === null || params.buildingId === undefined) {
62 65
       return
@@ -65,17 +68,17 @@ class ModalAttribution extends React.Component {
65 68
     request({ ...apis.customer.buildingConsultant, params: { ...params } }).then(res => {
66 69
       this.setState({ dataSource: res })
67 70
     }).catch(err => {
68
-      
71
+      message.err(err)
69 72
     })
70 73
   }
71 74
 
72 75
   getList(params) {
73 76
     // 网路请求
74 77
     console.log('params: ', params)
75
-    request({ ...apis.customer.buildingConsultant }).then(res => {
78
+    request({ ...apis.customer.buildingConsultant, params: { ...params } }).then(res => {
76 79
       this.setState({ dataSource: res })
77 80
     }).catch(err => {
78
-      
81
+
79 82
     })
80 83
   }
81 84
 
@@ -87,22 +90,27 @@ class ModalAttribution extends React.Component {
87 90
     });
88 91
   };
89 92
 
90
-   // 分页
93
+  // 分页
91 94
   onChange(pageNum) {
92 95
 
93
-    this.getUserList({ pageNumber: pageNum, pageSize: 5, buildingId: this.state.visibleData.buildingName })
96
+    this.getList({ pageNumber: pageNum, pageSize: 5, buildingId: this.state.visibleData.buildingName })
94 97
   }
95 98
 
96 99
   // 提交
97 100
   submitGm(record) {
98 101
     // 网路请求
99
-    request({ ...apis.customer.batchConsultantAssist, data: { userId: record.userId, personIds: this.state.visibleData.customerId } }).then(res => {
102
+    request({ ...apis.customer.batchConsultantAssist, data: { userId: record.userId, customerIds: this.state.visibleData.customerId } }).then(res => {
100 103
       // eslint-disable-next-line no-unused-expressions
101
-      this.openNotificationWithIcon('success', '操作成功')
104
+
105
+      if (res != null && res.failNum > 0) {
106
+        this.openNotificationWithIcon('success', '共' + res.totalNum + '条数据,失败操作' + res.failNum + '条')
107
+      } else {
108
+        this.openNotificationWithIcon('success', '操作成功')
109
+      }
102 110
       this.handleCancel()
103 111
     }).catch(err => {
104 112
       // eslint-disable-next-line no-unused-expressions
105
-      this.openNotificationWithIcon('error', err)
113
+
106 114
     })
107 115
   }
108 116
 
@@ -138,22 +146,23 @@ class ModalAttribution extends React.Component {
138 146
         dataIndex: 'personId',
139 147
         key: 'personId',
140 148
         // eslint-disable-next-line no-nested-ternary
141
-        render: (_, record) => <>{ <Button type="danger" onClick={() => this.submitGm(record)}>确定</Button>}</>, },
149
+        render: (_, record) => <>{<Button type="danger" onClick={() => this.submitGm(record)}>确定</Button>}</>,
150
+      },
142 151
     ]
143 152
     return (
144 153
       <>
145 154
         <Modal
146
-            title="分配置业顾问"
147
-            width={800}
148
-            destroyOnClose="true"
149
-            footer={null}
150
-            visible={this.state.visibleData.visible}
151
-            onCancel={(e) => this.handleCancel(e)}
152
-          >
153
-            <span>你正在为{this.props.visibleData.customerId.length}位公客分配置业顾问</span><br/><br/>
154
-            <BuildSelect onChange={this.changBuilding.bind(this)} value={this.state.visibleData.buildingName} />
155
-            <Table rowKey="BatchAssistConsultant" dataSource={this.state.dataSource.records} columns={columns} pagination={{pageSize: 5, total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
156
-          </Modal>
155
+          title="分配置业顾问"
156
+          width={800}
157
+          destroyOnClose="true"
158
+          footer={null}
159
+          visible={this.state.visibleData.visible}
160
+          onCancel={(e) => this.handleCancel(e)}
161
+        >
162
+          <span>你正在为{this.props.visibleData.customerId.length}位公客分配置业顾问</span><br /><br />
163
+          {this.props.visibleData.buildingId == null && <BuildSelect onChange={this.changBuilding.bind(this)} value={this.state.visibleData.buildingName} />}
164
+          <Table rowKey="BatchAssistConsultant" dataSource={this.state.dataSource.records} columns={columns} pagination={{ pageSize: 5, total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
165
+        </Modal>
157 166
       </>
158 167
     );
159 168
   }

+ 24
- 21
src/pages/customer/customerlist/components/assistConsultant.jsx Просмотреть файл

@@ -21,8 +21,8 @@ class ModalAttribution extends React.Component {
21 21
   constructor(props) {
22 22
     super(props);
23 23
     this.state = {
24
-       dataSource: { records: [] },
25
-       visibleData: { visible: false, customerId: '', buildingName: '' },
24
+      dataSource: { records: [] },
25
+      visibleData: { visible: false, customerId: '', buildingName: '' },
26 26
     }
27 27
   }
28 28
 
@@ -34,7 +34,7 @@ class ModalAttribution extends React.Component {
34 34
   componentDidUpdate(preProps, preState) {
35 35
     console.log(this.props.visibleData)
36 36
     if (this.props.visibleData.visible !== preState.visibleData.visible) {
37
-      this.getList({ pageNumber: 1, pageSize: 5, customerId: this.props.visibleData.customerId })
37
+      this.getList({ pageNumber: 1, pageSize: 5, customerId: this.props.visibleData.customerId, buildingId: this.props.visibleData.buildingId })
38 38
       this.setState({ visibleData: this.props.visibleData });
39 39
     }
40 40
   }
@@ -50,12 +50,13 @@ class ModalAttribution extends React.Component {
50 50
     this.props.onCancel()
51 51
   }
52 52
 
53
-  changBuilding(buildingId){
53
+  changBuilding(buildingId) {
54
+    console.log(buildingId,'buildingId')
54 55
     this.getUserList({ pageNumber: 1, pageSize: 5, buildingId: buildingId })
55 56
     this.setState({ visibleData: { visible: this.props.visibleData.visible, customerId: this.props.visibleData.customerId, buildingName: buildingId } });
56 57
   }
57 58
 
58
-  getUserList(params){
59
+  getUserList(params) {
59 60
     console.log('params: ', params)
60 61
     if (params.buildingId === '' || params.buildingId === null || params.buildingId === undefined) {
61 62
       return
@@ -64,7 +65,7 @@ class ModalAttribution extends React.Component {
64 65
     request({ ...apis.customer.buildingConsultant, params: { ...params } }).then(res => {
65 66
       this.setState({ dataSource: res })
66 67
     }).catch(err => {
67
-      
68
+      message.err(err)
68 69
     })
69 70
   }
70 71
 
@@ -73,7 +74,7 @@ class ModalAttribution extends React.Component {
73 74
     request({ ...apis.customer.buildingConsultant, params: { ...params } }).then(res => {
74 75
       this.setState({ dataSource: res })
75 76
     }).catch(err => {
76
-      
77
+      message.err(err)
77 78
     })
78 79
   }
79 80
 
@@ -85,9 +86,10 @@ class ModalAttribution extends React.Component {
85 86
     });
86 87
   };
87 88
 
88
-   // 分页
89
+  // 分页
89 90
   onChange(pageNum) {
90
-    this.getList({ pageNumber: pageNum, pageSize: 5, buildingId: this.state.visibleData.buildingName })
91
+    console.log(this.state.visibleData.buildingName)
92
+    this.getList({ pageNumber: pageNum, pageSize: 5, customerId: this.props.visibleData.customerId, buildingId: this.state.visibleData.buildingName })
91 93
   }
92 94
 
93 95
   // 提交
@@ -99,7 +101,7 @@ class ModalAttribution extends React.Component {
99 101
       this.handleCancel()
100 102
     }).catch(err => {
101 103
       // eslint-disable-next-line no-unused-expressions
102
-      this.openNotificationWithIcon('error', err)
104
+
103 105
     })
104 106
   }
105 107
 
@@ -135,21 +137,22 @@ class ModalAttribution extends React.Component {
135 137
         dataIndex: 'personId',
136 138
         key: 'personId',
137 139
         // eslint-disable-next-line no-nested-ternary
138
-        render: (_, record) => <>{ <Button type="danger" onClick={() => this.submitGm(record)}>确定</Button>}</>, },
140
+        render: (_, record) => <>{<Button type="danger" onClick={() => this.submitGm(record)}>确定</Button>}</>,
141
+      },
139 142
     ]
140 143
     return (
141 144
       <>
142 145
         <Modal
143
-            title="分配置业顾问"
144
-            width={800}
145
-            destroyOnClose="true"
146
-            footer={null}
147
-            visible={this.state.visibleData.visible}
148
-            onCancel={(e) => this.handleCancel(e)}
149
-          >
150
-            <BuildSelect onChange={this.changBuilding.bind(this)} value={this.state.visibleData.buildingName} />
151
-            <Table rowKey="assistConsultant" dataSource={this.state.dataSource.records} columns={columns} pagination={{pageSize: 5, total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
152
-          </Modal>
146
+          title="分配置业顾问"
147
+          width={800}
148
+          destroyOnClose="true"
149
+          footer={null}
150
+          visible={this.state.visibleData.visible}
151
+          onCancel={(e) => this.handleCancel(e)}
152
+        >
153
+          {this.props.visibleData.buildingId == null && <BuildSelect onChange={this.changBuilding.bind(this)} value={this.state.visibleData.buildingName} />}
154
+          <Table rowKey="assistConsultant" dataSource={this.state.dataSource.records} columns={columns} pagination={{ pageSize: 5, total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
155
+        </Modal>
153 156
       </>
154 157
     );
155 158
   }

+ 1
- 1
src/pages/customer/customerlist/components/integralRecord.jsx Просмотреть файл

@@ -142,7 +142,7 @@ class ModalIntegralRecord extends React.Component {
142 142
     return (
143 143
       <>
144 144
         <Modal
145
-            title={ '当前可用积分:' + this.state.dataSource.totalPoints }
145
+            title={ '当前可用积分:' + (this.state.dataSource.totalPoints  || 0 )}
146 146
             width={800}
147 147
             destroyOnClose="true"
148 148
             footer={null}

+ 1
- 1
src/pages/customer/customerlist/customerDetail.jsx Просмотреть файл

@@ -151,7 +151,7 @@ function header(props) {
151 151
               <p className={styles.rightItem}>国家:{dataConsultant && dataConsultant.country}</p>
152 152
               <p className={styles.rightItem}>省份:{dataConsultant && dataConsultant.provience}</p>
153 153
               <p className={styles.rightItem}>城市:{dataConsultant && dataConsultant.city}</p>
154
-              <p className={styles.rightItem}>来访渠道:{data.personFrom ? data.personFrom : "其他"}</p>
154
+              <p className={styles.rightItem}>来渠道:{data.personFrom ? data.personFrom : "其他"}</p>
155 155
               {/* <p className={styles.rightItem}>详细信息:</p> */}
156 156
               {/* <p className={styles.rightItem}>意向项目:{data.intention }</p> */}
157 157
               {/* <p className={styles.rightItem}>客户说明:{ data.verifyRemark }</p> */}

+ 733
- 719
src/pages/customer/customerlist/index.jsx
Разница между файлами не показана из-за своего большого размера
Просмотреть файл


+ 1
- 1
src/pages/customer/customerlist/publicCustomerDetail.jsx Просмотреть файл

@@ -139,7 +139,7 @@ function onChange(number) {
139 139
           <div className={publicStyle.Centered}>
140 140
           <p>访问时长:{ data.duration }秒</p>
141 141
           <p>访问次数:{ data.visitTimes }次</p>
142
-          <p className={publicStyle.rightItem}>来访渠道:{data.personFrom ? data.personFrom : '其他'}</p>
142
+          <p className={publicStyle.rightItem}>来渠道:{data.personFrom ? data.personFrom : '其他'}</p>
143 143
           {/* <p>预约人数:{ data.visiteNum }</p> */}
144 144
           </div>
145 145
           {/* <p className={styles.rightItem}>预约到访时间:{data.appointmentTime && moment(data.appointmentTime).format('YYYY-MM-DD') }</p> */}

+ 4
- 4
src/pages/indexEcharts/newUsers.jsx Просмотреть файл

@@ -38,9 +38,9 @@ const header = props => {
38 38
   useEffect(() => {
39 39
 
40 40
     setEndDate(new Date())
41
-    setStartDate(new Date())
41
+    setStartDate(moment().subtract(7, 'day').toDate())
42 42
     // setStartDate(moment().subtract(7, 'day').toDate())
43
-    userResource({startDate: new Date(), endDate: new Date()})
43
+    userResource({startDate: moment().subtract(7, 'day').toDate(), endDate: new Date()})
44 44
   }, [])
45 45
 
46 46
   const { RangePicker } = DatePicker;
@@ -152,8 +152,8 @@ const header = props => {
152 152
       borderRadius: '12px',
153 153
       minHeight: '60vh'
154 154
     }}>
155
-      <Radio.Group onChange={onChange} buttonStyle="solid" defaultValue="c"  style={{marginBottom:'20px'}}>
156
-        <Radio.Button value="c" onClick={getDataOf(0)}>今日</Radio.Button>
155
+      <Radio.Group onChange={onChange} buttonStyle="solid" defaultValue="a"  style={{marginBottom:'20px'}}>
156
+        {/* <Radio.Button value="c" onClick={getDataOf(0)}>今日</Radio.Button> */}
157 157
         <Radio.Button value="a" onClick={getDataOf(7)}>最近7天</Radio.Button>
158 158
         <Radio.Button value="b" onClick={getDataOf(30)}>最近1月</Radio.Button>
159 159
       </Radio.Group>

+ 1
- 1
src/pages/integralMall/editGoods.jsx Просмотреть файл

@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react';
2 2
 import { Input, Menu, Dropdown, Button, Icon, message, Table, Divider, Tag, Select, Form, Alert } from 'antd';
3 3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4 4
 import channels from '../channel/channelList.less';
5
-import BuildSelect from '../../components/SelectButton/BuildSelect'
5
+import BuildSelect from '../../components/SelectButton/BuildSelect2'
6 6
 import XForm, { FieldTypes } from '../../components/XForm';
7 7
 import Wangedit from '../../components/Wangedit/Wangedit'
8 8
 import router from 'umi/router';

+ 1
- 1
src/pages/news/list/editNewsList.jsx Просмотреть файл

@@ -5,7 +5,7 @@ import styles from '../../style/GoodsList.less';
5 5
 import apis from '../../../services/apis';
6 6
 import moment from 'moment';
7 7
 import router from 'umi/router';
8
-import BuildSelect from '../../../components/SelectButton/BuildSelect'
8
+import BuildSelect from '../../../components/SelectButton/BuildSelect2'
9 9
 import NewsTypeSelect from '../../../components/SelectButton/NewTypeSelect'
10 10
 import  { FieldTypes, createForm } from '../../../components/XForm';
11 11
 import Wangedit from '../../../components/Wangedit/Wangedit'

+ 24
- 14
src/pages/recommend/recommendCustomer/audit.jsx Просмотреть файл

@@ -56,12 +56,13 @@ function body(props) {
56 56
   function getById(currentId) {
57 57
     request({ ...apis.customer.recommendGetById, urlData: { id: currentId } }).then(res => {
58 58
       res.reportDate = moment(res.reportDate)
59
-     props.form.setFieldsValue(res)
59
+      props.form.setFieldsValue(res)
60 60
     })
61 61
   }
62 62
 
63 63
   function submitDate(params) {
64 64
     // props.form.setFieldsValue(res)
65
+    console.log(params, 'params')
65 66
     request({ ...apis.customer.auto, urlData: { id: params.customerId || props.form.getFieldValue('customerId') }, params: { verifyStatus: params.verifyStatus, realtyConsultant: props.form.getFieldValue('realtyConsultant') } }).then(() => {
66 67
       // eslint-disable-next-line no-unused-expressions
67 68
       openNotificationWithIcon('success', '操作成功')
@@ -77,7 +78,8 @@ function body(props) {
77 78
     e.preventDefault();
78 79
     props.form.validateFields((err, values) => {
79 80
       if (!err) {
80
-        submitDate({ ...values })
81
+        submitDate({ verifyStatus: '1' })
82
+        // submitDate({ ...values })
81 83
       }
82 84
     });
83 85
   }
@@ -195,20 +197,28 @@ function body(props) {
195 197
               <Option value={1}>已通过</Option>
196 198
               <Option value={2}>已驳回</Option>
197 199
             </Select>,
198
-          )}
200
+          )}onClick={() => submitDate({ verifyStatus: '1' })}
199 201
         </Form.Item> */}
200
-        <Form.Item label="归属置业顾问">
201
-            <Row gutter={8}>
202
-              <Col span={12}>
203
-                {getFieldDecorator('consultantName')(<Input placeholder="请选择置业顾问" />)}
204
-              </Col>
205
-              <Col span={12}>
206
-                <Button onClick={() => showConsultant()}>选择</Button>
207
-              </Col>
208
-            </Row>
202
+        <Form.Item label="归属置业顾问"
203
+      >
204
+          <Row gutter={8}>
205
+            <Col span={12}>
206
+              {getFieldDecorator('consultantName', {
207
+                rules: [
208
+                  {
209
+                    required: true,
210
+                    message: '请选择置业顾问',
211
+                  },
212
+                ],
213
+              })(<Input placeholder="请选择置业顾问" />)}
214
+            </Col>
215
+            <Col span={12}>
216
+              <Button onClick={() => showConsultant()}>选择</Button>
217
+            </Col>
218
+          </Row>
209 219
         </Form.Item>
210 220
         <Form.Item style={{ display: 'flex', justifyContent: 'center' }}>
211
-          <Button type="primary" className={Styles.SubmitButton} onClick={() => submitDate({ verifyStatus: '1' })}>
221
+          <Button type="primary" className={Styles.SubmitButton} htmlType="submit" >
212 222
             审核通过
213 223
           </Button>
214 224
           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
@@ -219,7 +229,7 @@ function body(props) {
219 229
       </Form>
220 230
 
221 231
       {/* 选择置业顾问 */}
222
-      <Attribution visibleData={visibleData} onCancel={() => closeConsultant()} onSuccess={e => consultantSuccess(e)}/>
232
+      <Attribution visibleData={visibleData} onCancel={() => closeConsultant()} onSuccess={e => consultantSuccess(e)} />
223 233
     </>
224 234
   );
225 235
 }

+ 129
- 0
src/pages/staff/components/BatchAssistConsultant.jsx Просмотреть файл

@@ -0,0 +1,129 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Radio, Modal, Descriptions, notification } from 'antd';
3
+import moment from 'moment';
4
+import request from '../../../utils/request';
5
+import apis from '../../../services/apis';
6
+
7
+
8
+const { Option } = Select;
9
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
10
+const { Meta } = Card;
11
+
12
+/**
13
+ * 分配置业顾问
14
+ *
15
+ * @param {*} props
16
+ * @returns
17
+ */
18
+class ModalAttribution extends React.Component {
19
+  constructor(props) {
20
+    super(props);
21
+    // console.log(props, 'props')
22
+    this.state = {
23
+      dataSource: { records: [] },
24
+      visibleData: { visible: false, buildingId: '' },
25
+    }
26
+  }
27
+
28
+  // 挂载之后
29
+  componentDidMount() {
30
+    // this.getList({ pageNumber: 1, pageSize: 5 })
31
+  }
32
+
33
+  componentDidUpdate(preProps, preState) {
34
+    if (this.props.visible !== preState.visibleData.visible) {
35
+      this.getUserList({ pageNumber: 1, pageSize: 5, buildingId: this.props.buildingId })
36
+      this.setState({ visibleData: { visible: this.props.visible, buildingId: this.props.buildingId } });
37
+    }
38
+  }
39
+
40
+  // 弹框取消按钮
41
+  handleCancel() {
42
+    this.props.onCancel()
43
+  }
44
+
45
+  getUserList(params) {
46
+    console.log('params: ', params)
47
+    if (params.buildingId === '' || params.buildingId === null || params.buildingId === undefined) {
48
+      return
49
+    }
50
+    // 网路请求
51
+    request({ ...apis.customer.buildingConsultant, params: { ...params } }).then(res => {
52
+      this.setState({ dataSource: res })
53
+    }).catch(err => {
54
+
55
+    })
56
+  }
57
+
58
+  openNotificationWithIcon = (type, message) => {
59
+    notification[type]({
60
+      message,
61
+      description:
62
+        '',
63
+    });
64
+  };
65
+
66
+  // 分页
67
+  onChange(pageNum) {
68
+
69
+    this.getUserList({ pageNumber: pageNum, pageSize: 5, buildingId: this.state.visibleData.buildingId })
70
+  }
71
+
72
+  // 提交
73
+  submitGm(record) {
74
+    this.props.onCancel(record)
75
+  }
76
+
77
+  render() {
78
+    const columns = [
79
+      {
80
+        title: '姓名',
81
+        dataIndex: 'userName',
82
+        key: 'userName',
83
+        width: 120,
84
+      },
85
+      {
86
+        title: '电话',
87
+        dataIndex: 'phone',
88
+        key: 'phone',
89
+        width: 150,
90
+      },
91
+      {
92
+        title: '部门',
93
+        dataIndex: 'department',
94
+        key: 'department',
95
+        width: 130,
96
+      },
97
+      {
98
+        title: '岗位',
99
+        dataIndex: 'position',
100
+        key: 'position',
101
+        width: 120,
102
+      },
103
+      {
104
+        title: '操作',
105
+        dataIndex: 'personId',
106
+        key: 'personId',
107
+        width: 80,
108
+        // eslint-disable-next-line no-nested-ternary
109
+        render: (_, record) => <>{record.userId !== this.props.userId ? <Button type="danger" onClick={() => this.submitGm(record)}>确定</Button> : ''}</>,
110
+      },
111
+    ]
112
+    return (
113
+      <>
114
+        <Modal
115
+          title="分配置业顾问"
116
+          width={600}
117
+          destroyOnClose="true"
118
+          footer={null}
119
+          visible={this.state.visibleData.visible}
120
+          onCancel={(e) => this.handleCancel(e)}
121
+        >
122
+          <Table rowKey="userId" dataSource={this.state.dataSource.records} columns={columns} pagination={{ pageSize: 5, total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
123
+        </Modal>
124
+      </>
125
+    );
126
+  }
127
+}
128
+
129
+export default ModalAttribution

+ 58
- 0
src/pages/staff/components/BuildingSelection.jsx Просмотреть файл

@@ -0,0 +1,58 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Input, Menu, Dropdown, Button, Icon, message, Table, Tooltip, Tabs, Radio, Divider, Tag, Select, Form, Alert, Modal } from 'antd';
3
+import request from '../../../utils/request';
4
+import apis from '../../../services/apis';
5
+import CustomerChange from './CustomerChange'
6
+import BuildSelect from '@/components/SelectButton/BuildSelect'
7
+
8
+let building = null
9
+const BuildingSelection = (props) => {
10
+    const [visible, setVisible] = useState(false) 
11
+    const { userData } = props;
12
+
13
+     //授权项目改变
14
+  const consultantBuildingChange =(e) => {
15
+    building = e
16
+    if(userData.isConsultant && props.value !== e){
17
+      request({ ...apis.staff.check, params: { userId: userData.userId, personId: userData.consultantPersonId, buildingId: userData.buildingId } }).then(res => {
18
+        if(res.length > 0){
19
+          Modal.confirm({
20
+            title: '此置业顾问下有私客,是否转移私客?',
21
+            okText: '确认',
22
+            cancelText: '取消',
23
+            onOk () {
24
+              setVisible(true)
25
+            },
26
+          });
27
+        }else{
28
+            props.onChange(e)
29
+        }
30
+     })
31
+    }else{
32
+        props.onChange(e)
33
+    }
34
+  }
35
+
36
+   //迁移私客成功回调
37
+   const moveSuccess = (e) => {
38
+       if(e === 'success'){
39
+        props.onChange(building)
40
+       }
41
+       setVisible(false)
42
+  }
43
+
44
+     return (<>
45
+        <BuildSelect value={props.value} onChange={consultantBuildingChange} />
46
+        <Modal
47
+              visible={visible}
48
+              title="分配归属"
49
+              onCancel={() => setVisible(false)}
50
+              footer={null}
51
+              width={900}
52
+            >
53
+                <CustomerChange userId={userData.userId} consultantPersonId={userData.consultantPersonId} buildingId={userData.buildingId} onSuccess={moveSuccess} />
54
+            </Modal>
55
+     </>)
56
+  }
57
+  
58
+  export default BuildingSelection;

+ 117
- 0
src/pages/staff/components/CustomerChange.jsx Просмотреть файл

@@ -0,0 +1,117 @@
1
+import React, { Component, useState, useEffect } from 'react';
2
+import echarts from 'echarts/lib/echarts';
3
+import EChart from '../../../components/EchartsTest/EChart';
4
+import request from '../../../utils/request';
5
+import apis from '../../../services/apis';
6
+import moment from 'moment';
7
+import router from 'umi/router';
8
+import { Table, Select, Row, Col, Menu, Dropdown, Button, Icon, message } from 'antd';
9
+import BatchAssistConsultant from './BatchAssistConsultant'
10
+
11
+const CustomerChange = (props) => {
12
+  const [data, setData] = useState([])
13
+  const [consultantVisible, setConsultantVisible] = useState(false)
14
+  const [selectIds, setSelectIds] = useState([])
15
+
16
+  const rowSelection = {
17
+    selectedRowKeys: selectIds,
18
+    onChange: (selectedRowKeys, selectedRows) => {
19
+      console.log('selectedRowKeys:', selectedRowKeys, 'selectedRows: ', selectedRows);
20
+      setSelectIds(selectedRowKeys)
21
+    },
22
+  };
23
+
24
+  const batchAssistConsultant = () => {
25
+    if (selectIds.length < 1) {
26
+      message.info("请至少选择一条数据");
27
+      return
28
+    }
29
+    setConsultantVisible(true)
30
+  }
31
+
32
+  const consulatanChange = (e) => {
33
+    if (e) {
34
+      data.map(x => {
35
+        selectIds.map(y => {
36
+          if (x.customerId === y) {
37
+            x.realtyConsultant = e.userId
38
+            x.moveUserId = e.userId
39
+            x.moveUserName = e.userName
40
+          }
41
+        })
42
+      })
43
+    }
44
+    setConsultantVisible(false)
45
+    setSelectIds([])
46
+  }
47
+
48
+  //批量保存
49
+  const batchSaveConsultant = () => {
50
+    const unMoveData = data.filter(x => !x.moveUserId)
51
+    if (unMoveData.length > 0) {
52
+      message.info("存在未分配归属客户");
53
+      return
54
+    }
55
+    request({ ...apis.staff.move, data }).then(data => {
56
+      message.info('操作成功')
57
+      props.onSuccess('success')
58
+    })
59
+  }
60
+
61
+  //取消按钮
62
+  const cancelConsultant = () => {
63
+    props.onSuccess('cancel')
64
+  }
65
+
66
+
67
+  const columns = [
68
+    {
69
+      title: '用户名',
70
+      dataIndex: 'name',
71
+      key: 'name',
72
+      align: 'center',
73
+    },
74
+    {
75
+      title: '手机号',
76
+      dataIndex: 'phone',
77
+      key: 'phone',
78
+      align: 'center',
79
+    },
80
+    {
81
+      title: '客户状态',
82
+      dataIndex: 'reportRecommendStatus',
83
+      key: 'reportRecommendStatus',
84
+      align: 'center',
85
+      render: (text, records) => {
86
+        if (records.status === 1) { return '报备' }
87
+        if (records.status === 2) { return '到访' }
88
+        if (records.status === 3) { return '认购' }
89
+        if (records.status === 4) { return '签约' }
90
+      },
91
+    },
92
+    {
93
+      title: '调整后归属',
94
+      dataIndex: 'moveUserName',
95
+      key: 'moveUserName',
96
+      align: 'center',
97
+    }
98
+  ];
99
+
100
+  useEffect(() => {
101
+    request({ ...apis.staff.check, params: { userId: props.userId, personId: props.consultantPersonId, buildingId: props.buildingId } }).then(data => {
102
+      setData(data)
103
+    })
104
+  }, [props.userId])
105
+
106
+  return (
107
+    <div>
108
+      <Button type="primary" onClick={() => batchAssistConsultant()} style={{ float: 'right', margin: '20px 0', marginLeft: '20px', zIndex: 1 }}>分配置业顾问</Button>
109
+      <Table rowSelection={rowSelection} dataSource={data} columns={columns} rowKey="customerId" pagination={false} scroll={{ y: 500 }} />
110
+      <BatchAssistConsultant visible={consultantVisible} userId={props.userId} buildingId={props.buildingId} onCancel={consulatanChange} />
111
+      <div style={{ textAlign: 'center', marginTop: '16px' }}><Button type="primary" onClick={() => batchSaveConsultant()}>保存</Button>
112
+        <Button style={{ marginLeft: '10px' }} onClick={() => cancelConsultant()}>取消</Button></div>
113
+    </div>
114
+  )
115
+}
116
+
117
+export default CustomerChange;

+ 107
- 48
src/pages/staff/list/StaffList.jsx Просмотреть файл

@@ -9,6 +9,7 @@ import apis from '../../../services/apis';
9 9
 import request from '../../../utils/request'
10 10
 import Styles from './style.less';
11 11
 import BuildingSelect from '@/components/SelectButton/BuildSelect';
12
+import CustomerChange from '../components/CustomerChange'
12 13
 
13 14
 const { Meta } = Card;
14 15
 const { Option } = Select;
@@ -32,29 +33,59 @@ const toEditStaff = userId => () => {
32 33
  */
33 34
 const CartBody = props => {
34 35
   const { data } = props
36
+  const [visible, setVisible] = useState(false)
35 37
   // console.log("data11:", data)
36 38
 
37 39
   const confirm = data => () => {
38 40
     // console.log(data, "11111")
39 41
     if (data.status === 1) {
40
-      Modal.confirm({
41
-        title: '停用后无法登录后台系统',
42
-        okText: '确认',
43
-        cancelText: '取消',
44
-        onOk () {
45
-          request({ ...apis.staff.change, urlData: { id: data.userId, type: 'off' } }).then(data => {
46
-            message.info('操作成功')
47
-            props.onFresh()
48
-          })
49
-        },
50
-      });
42
+      if(data.isConsultant){
43
+        request({ ...apis.staff.check, params: { userId: data.userId, personId: data.consultantPersonId, buildingId: data.buildingId } }).then(res => {
44
+          if(res.length > 0){
45
+            Modal.confirm({
46
+              title: '此置业顾问下有私客,是否转移私客?',
47
+              okText: '确认',
48
+              cancelText: '取消',
49
+              onOk () {
50
+                setVisible(true)
51
+              },
52
+            });
53
+          }else{
54
+            const titleMessahe = data.isConsultant ? '停用后此员工无法继续登录后台(若为置业顾问停用后在小程序端将成为普通用户)确认进行停用操作?' : '停用后此员工无法继续登录后台,确认进行停用操作?';
55
+            Modal.confirm({
56
+              title: titleMessahe,
57
+              okText: '确认',
58
+              cancelText: '取消',
59
+              onOk () {
60
+                request({ ...apis.staff.change, urlData: { id: data.userId, type: 'off' } }).then(res => {
61
+                  message.info('操作成功')
62
+                  props.onFresh()
63
+                })
64
+              },
65
+            });
66
+          }
67
+       })
68
+      }else{
69
+        const titleMessahe = data.isConsultant ? '停用后此员工无法继续登录后台(若为置业顾问停用后在小程序端将成为普通用户)确认进行停用操作?' : '停用后此员工无法继续登录后台,确认进行停用操作?';
70
+        Modal.confirm({
71
+          title: titleMessahe,
72
+          okText: '确认',
73
+          cancelText: '取消',
74
+          onOk () {
75
+            request({ ...apis.staff.change, urlData: { id: data.userId, type: 'off' } }).then(res => {
76
+              message.info('操作成功')
77
+              props.onFresh()
78
+            })
79
+          },
80
+        });
81
+      }
51 82
     } else {
52 83
       Modal.confirm({
53 84
         title: '确认启用该角色?',
54 85
         okText: '确认',
55 86
         cancelText: '取消',
56 87
         onOk () {
57
-          request({ ...apis.staff.change, urlData: { id: data.userId, type: 'on' } }).then(data => {
88
+          request({ ...apis.staff.change, urlData: { id: data.userId, type: 'on' } }).then(res => {
58 89
             message.info('操作成功')
59 90
             props.onFresh()
60 91
           })
@@ -63,6 +94,14 @@ const CartBody = props => {
63 94
     }
64 95
   }
65 96
 
97
+  //迁移私客成功回调
98
+  const moveSuccess = (e) => {
99
+    setVisible(false)
100
+    if(e === 'success'){
101
+      confirm(data)()
102
+    }
103
+  }
104
+
66 105
   // 员工离职
67 106
   const departure = row => {
68 107
     // 是置业顾问
@@ -95,45 +134,55 @@ const CartBody = props => {
95 134
   }
96 135
 
97 136
   return (
137
+    <div>
138
+      <Card className={Styles.card}>
139
+        <div>
140
+          <Avatar src={data.photo} style={{ width: '0.48rem', height: '0.48rem' }} />
141
+          <AuthButton name="admin.user.put" noRight={null}>
142
+          <Button type="link" style={{ color: '#FF925C', fontSize: '0.106rem', position: 'absolute', top: '40px', left: '0.56rem' }} onClick={toEditStaff(data.userId)}>
143
+            编辑
144
+                  <Icon type="form" style={{ color: '#C0C4CC', marginLeft: '0.04rem' }} />
145
+          </Button>
146
+          </AuthButton>
147
+          {/* <Button type="link" style={{ fontSize: ' 0.106rem', color: '#cacaca', position: 'absolute', top: '40px', right: '0' }} onClick={() => departure(data)}>
148
+            离职
149
+                  <Icon type="exclamation-circle" style={{ color: '#C0C4CC', marginLeft: '0.04rem' }} />
150
+          </Button> */}
151
+          <AuthButton name="admin.user.publish" noRight={null}>
152
+          <Button type="link" style={{ fontSize: ' 0.106rem', color: '#cacaca', position: 'absolute', top: '40px', right: '0' }} onClick={confirm(data)}>
153
+            {data.status === 1 ? '停用' : '启用'}
154
+            <Icon type={data.status === 1 ? 'close-circle' : 'form'} style={{ color: '#C0C4CC', marginLeft: '0.04rem' }} />
155
+          </Button>
156
+          </AuthButton>
157
+        </div>
158
+        <div>
98 159
 
99
-    <Card className={Styles.card}>
100
-      <div>
101
-        <Avatar src={data.photo} style={{ width: '0.48rem', height: '0.48rem' }} />
102
-        <AuthButton name="admin.user.put" noRight={null}>
103
-        <Button type="link" style={{ color: '#FF925C', fontSize: '0.106rem', position: 'absolute', top: '40px', left: '0.56rem' }} onClick={toEditStaff(data.userId)}>
104
-          编辑
105
-                <Icon type="form" style={{ color: '#C0C4CC', marginLeft: '0.04rem' }} />
106
-        </Button>
107
-        </AuthButton>
108
-        {/* <Button type="link" style={{ fontSize: ' 0.106rem', color: '#cacaca', position: 'absolute', top: '40px', right: '0' }} onClick={() => departure(data)}>
109
-          离职
110
-                <Icon type="exclamation-circle" style={{ color: '#C0C4CC', marginLeft: '0.04rem' }} />
111
-        </Button> */}
112
-        <AuthButton name="admin.user.publish" noRight={null}>
113
-        <Button type="link" style={{ fontSize: ' 0.106rem', color: '#cacaca', position: 'absolute', top: '40px', right: '0' }} onClick={confirm(data)}>
114
-          {data.status === 1 ? '停用' : '启用'}
115
-          <Icon type={data.status === 1 ? 'close-circle' : 'form'} style={{ color: '#C0C4CC', marginLeft: '0.04rem' }} />
116
-        </Button>
117
-        </AuthButton>
118
-      </div>
119
-      <div>
160
+          <span>
161
+            {
162
+              data.taTagsList.map((item, index) => <Tag className={Styles.cardTag} color={item.tagColor}>{item.tagName}</Tag>)
163
+            }
164
+          </span>
120 165
 
121
-        <span>
122
-          {
123
-            data.taTagsList.map((item, index) => <Tag className={Styles.cardTag} color={item.tagColor}>{item.tagName}</Tag>)
124
-          }
125
-        </span>
126
-
127
-        <p className={Styles.cardText} >姓名 : {data.userName}
128
-        </p>
129
-        {/* <p className={Styles.statusText} > 状态 : {data.status === 1 ? '启用' : '停用'} </p> */}
130
-        <p className={Styles.statusText} > 绑定状态 : {data.miniStatus === 1 ? '已绑定' : '未绑定'} </p>
131
-        <p className={Styles.phoneText} >
132
-          电话 : {data.phone}
133
-        </p>
134
-      </div>
166
+          <p className={Styles.cardText} >姓名 : {data.userName}
167
+          </p>
168
+          {/* <p className={Styles.statusText} > 状态 : {data.status === 1 ? '启用' : '停用'} </p> */}
169
+          <p className={Styles.statusText} > 绑定状态 : {data.miniStatus === 1 ? '已绑定' : '未绑定'} </p>
170
+          <p className={Styles.phoneText} >
171
+            电话 : {data.phone}
172
+          </p>
173
+        </div>
135 174
 
136
-    </Card>
175
+      </Card>
176
+      <Modal
177
+        visible={visible}
178
+        title="分配归属"
179
+        onCancel={() => setVisible(false)}
180
+        footer={null}
181
+        width={900}
182
+      >
183
+          <CustomerChange userId={data.userId} consultantPersonId={data.consultantPersonId} buildingId={data.buildingId} onSuccess={moveSuccess} />
184
+      </Modal>
185
+    </div>
137 186
   )
138 187
 }
139 188
 
@@ -219,6 +268,16 @@ const header = props => {
219 268
           )}
220 269
         </Form.Item>
221 270
 
271
+        <Form.Item>
272
+
273
+          {getFieldDecorator('miniStatus')(
274
+            <Select style={{ width: '180px' }} placeholder="是否绑定" >
275
+              <Option value="0">未绑定</Option>
276
+              <Option value="1">已绑定</Option>
277
+            </Select>,
278
+          )}
279
+        </Form.Item>
280
+
222 281
         <Form.Item>
223 282
         <AuthButton name="admin.user.search" noRight={null}>
224 283
           <Button type="primary" htmlType="submit" className={styles.searchBtn}>

+ 40
- 4
src/pages/staff/list/editStaff.jsx Просмотреть файл

@@ -1,6 +1,6 @@
1 1
 import React, { useState, useEffect } from 'react';
2 2
 
3
-import { Input, Menu, Dropdown, Button, Icon, message, Table, Tooltip, Tabs, Radio, Divider, Tag, Select, Form, Alert } from 'antd';
3
+import { Input, Menu, Dropdown, Button, Icon, message, Table, Tooltip, Tabs, Radio, Divider, Tag, Select, Form, Alert, Modal } from 'antd';
4 4
 import { FormattedMessage } from 'umi-plugin-react/locale';
5 5
 import BuildSelect from '../../../components/SelectButton/BuildSelect'
6 6
 import router from 'umi/router';
@@ -11,6 +11,7 @@ import channels from './channelList.less';
11 11
 import Tagss from '../components/Tagss.jsx';
12 12
 import apis from '../../../services/apis';
13 13
 import request from '../../../utils/request'
14
+import BuildingSelection from '../components/BuildingSelection'
14 15
 
15 16
 const { TextArea } = Input;
16 17
 const { Option } = Select;
@@ -38,6 +39,7 @@ const Edit = (props) => {
38 39
   const [tagData, setTagData] = useState([])
39 40
   const [roleData, setRoleData] = useState([])
40 41
   const [buildData, setBuildData] = useState([])
42
+  const [visible, setVisible] = useState(false)
41 43
 
42 44
   const getTagList = () => {
43 45
     request({ ...apis.staff.taTags, params: { pageNum: 1, pageSize: 999 } }).then((data) => {
@@ -123,6 +125,29 @@ const Edit = (props) => {
123 125
     return isLt100k;
124 126
   }
125 127
 
128
+  //授权项目改变
129
+  const consultantBuildingChange =(e) => {
130
+    if(userData.isConsultant){
131
+      request({ ...apis.staff.check, params: { userId: userData.userId, personId: userData.consultantPersonId, buildingId: userData.buildingId } }).then(res => {
132
+        if(res.length > 0){
133
+          Modal.confirm({
134
+            title: '此置业顾问下有私客,是否转移私客?',
135
+            okText: '确认',
136
+            cancelText: '取消',
137
+            onOk () {
138
+              setVisible(true)
139
+            },
140
+          });
141
+        }
142
+     })
143
+    }
144
+  }
145
+
146
+   //迁移私客成功回调
147
+   const moveSuccess = (e) => {
148
+    setVisible(false)
149
+  }
150
+
126 151
   const fields = [
127 152
     {
128 153
       label: '姓名',
@@ -190,7 +215,7 @@ const Edit = (props) => {
190 215
       type: FieldTypes.Text,
191 216
       placeholder: '请输入登录名',
192 217
       value: userData.loginName,
193
-      hidden: () => consultantChecked,
218
+      // hidden: () => consultantChecked,
194 219
       help: '默认密码:123456',
195 220
     },
196 221
     {
@@ -212,7 +237,7 @@ const Edit = (props) => {
212 237
     {
213 238
       label: '授权项目',
214 239
       name: 'buildingId',
215
-      render: <BuildSelect />,
240
+      render: <BuildingSelection userData={userData} />,
216 241
       value: userData.buildingId,
217 242
       hidden: () => !consultantChecked,
218 243
       rules: [
@@ -282,7 +307,18 @@ const Edit = (props) => {
282 307
 
283 308
   console.log('--------->', fields)
284 309
 
285
-  return <XForm onChange={console.log} onSubmit={handleSubmit} fields={fields.filter(Boolean)} onCancel={() => router.go(-1)}></XForm>
310
+  return <div>
311
+            <XForm onChange={console.log} onSubmit={handleSubmit} fields={fields.filter(Boolean)} onCancel={() => router.go(-1)}></XForm>
312
+            {/* <Modal
313
+              visible={visible}
314
+              title="分配归属"
315
+              onCancel={() => setVisible(false)}
316
+              footer={null}
317
+              width={900}
318
+            >
319
+                <CustomerChange userId={userData.userId} consultantPersonId={userData.consultantPersonId} buildingId={userData.buildingId} onSuccess={moveSuccess} />
320
+            </Modal> */}
321
+        </div>
286 322
 }
287 323
 
288 324
 export default Edit

+ 2
- 0
src/pages/statistical/activity/shareNum.jsx Просмотреть файл

@@ -36,6 +36,7 @@ let columns = [
36 36
       if (records.sharePersonType === 'drift') { return '游客' }
37 37
       if (records.sharePersonType === 'customer') { return '普通客户' }
38 38
       if (records.sharePersonType === 'Realty Consultant') { return '置业顾问' }
39
+      if (records.sharePersonType === 'estate agent') { return '专业经纪人' }
39 40
     },
40 41
   },
41 42
   {
@@ -217,6 +218,7 @@ class SharePersonNum extends React.Component {
217 218
                 <Option value="drift">游客</Option>
218 219
                 <Option value="customer">普通客户</Option>
219 220
                 <Option value="Realty Consultant">置业顾问</Option>
221
+                <Option value="estate agent">专业经纪人</Option>
220 222
             </Select>
221 223
             )}
222 224
           </Form.Item>

+ 2
- 0
src/pages/statistical/activity/sharePersonNum.jsx Просмотреть файл

@@ -95,6 +95,7 @@ let columns = [
95 95
       if (records.sharePersonType === 'drift') { return '游客' }
96 96
       if (records.sharePersonType === 'customer') { return '普通客户' }
97 97
       if (records.sharePersonType === 'Realty Consultant') { return '置业顾问' }
98
+      if (records.sharePersonType === 'estate agent') { return '专业经纪人' }
98 99
     },
99 100
   },
100 101
   {
@@ -306,6 +307,7 @@ class SharePersonNum extends React.Component {
306 307
                 <Option value="drift">游客</Option>
307 308
                 <Option value="customer">普通客户</Option>
308 309
                 <Option value="Realty Consultant">置业顾问</Option>
310
+                <Option value="estate agent">专业经纪人</Option>
309 311
               </Select>
310 312
             )}
311 313
           </Form.Item>

+ 2
- 1
src/pages/statistical/consultant/index.jsx Просмотреть файл

@@ -400,6 +400,7 @@ function record(props) {
400 400
     ]
401 401
     const list = data.records
402 402
     const _list = list && list.length > 0 ? [totalRow, ...list] : [];
403
+    let row = 0
403 404
     return (
404 405
 
405 406
         <>
@@ -454,7 +455,7 @@ function record(props) {
454 455
                     导出
455 456
                 </Button>
456 457
             </AuthButton>
457
-            <Table rowKey={(index => { index })}
458
+            <Table rowKey={record => data.current * data.size + (row++)}
458 459
                 style={{ marginTop: '30px' }}
459 460
                 dataSource={_list}
460 461
                 // dataSource={data.records}

+ 10
- 0
src/services/apis.js Просмотреть файл

@@ -831,6 +831,16 @@ export default {
831 831
       method: 'PUT',
832 832
       action: 'admin.turn.taUser.put',
833 833
     },
834
+    check: {
835
+      url: `${prefix}/consultant/customer/list`,
836
+      method: 'GET',
837
+      action: 'admin.consultant.customer.list.put',
838
+    },
839
+    move: {
840
+      url: `${prefix}/consultant/customer/move`,
841
+      method: 'PUT',
842
+      action: 'admin.user.departure.put',
843
+    },
834 844
     departure: {
835 845
       url: `${prefix}/user/departure/:id`,
836 846
       method: 'PUT',