zhoulisen 5 年前
父节点
当前提交
f3bd4e60dc

+ 9
- 5
src/components/GlobalHeader/AvatarDropdown.jsx 查看文件

80
     return currentUser && currentUser.userName ? (
80
     return currentUser && currentUser.userName ? (
81
       <>
81
       <>
82
         <HeaderDropdown overlay={menuHeaderDropdown}>
82
         <HeaderDropdown overlay={menuHeaderDropdown}>
83
-            <span className={`${styles.action} ${styles.account}`}>
84
-              <Avatar size="small" className={styles.avatar} src={currentUser.avatar === null ? currentUser.photo:currentUser.avatar} alt="avatar" />
85
-              <span className={styles.name}>{currentUser.loginName}</span>
86
-              <span className={styles.name}>欢迎登录{currentUser.miniAppName}</span>
87
-            </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>
88
         </HeaderDropdown>
92
         </HeaderDropdown>
89
 
93
 
90
         {/* 修改密码 */}
94
         {/* 修改密码 */}

+ 10
- 3
src/components/GlobalHeader/index.less 查看文件

4
 .name {
4
 .name {
5
 
5
 
6
   color: #fff;
6
   color: #fff;
7
+  padding: 0;
8
+  margin: 0;
9
+  height: 20px;
10
+  line-height: 20px;
11
+    
7
 }
12
 }
8
 .logo {
13
 .logo {
9
   display: inline-block;
14
   display: inline-block;
46
   .action {
51
   .action {
47
     display: inline-block;
52
     display: inline-block;
48
     height: 100%;
53
     height: 100%;
49
-    padding: 0 12px;
54
+    padding: 0 40px;
50
     cursor: pointer;
55
     cursor: pointer;
51
     transition: all 0.3s;
56
     transition: all 0.3s;
52
     > i {
57
     > i {
68
   }
73
   }
69
   .account {
74
   .account {
70
     .avatar {
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
       color: @primary-color;
80
       color: @primary-color;
74
       vertical-align: top;
81
       vertical-align: top;
75
       background: rgba(255, 255, 255, 0.85);
82
       background: rgba(255, 255, 255, 0.85);

+ 90
- 43
src/pages/activity/editActivity.jsx 查看文件

37
   const [activityStatus, setActivityStatus] = useState(1)
37
   const [activityStatus, setActivityStatus] = useState(1)
38
   const [disable, setDisable] = useState(false)
38
   const [disable, setDisable] = useState(false)
39
   const [data, setData] = useState(1)
39
   const [data, setData] = useState(1)
40
-  const [signupTime, setSignupTime] = useState([])
40
+  const [showSignupTime, setShowSignupTime] = useState([])
41
 
41
 
42
 
42
 
43
   const radioOnChange = e => {
43
   const radioOnChange = e => {
52
       console.log(data)
52
       console.log(data)
53
       data.activityTime = [moment(data.startDate), moment(data.endDate)]
53
       data.activityTime = [moment(data.startDate), moment(data.endDate)]
54
       data.signupTime = [moment(data.enlistStart), moment(data.enlistEnd)]
54
       data.signupTime = [moment(data.enlistStart), moment(data.enlistEnd)]
55
-      setSignupTime([moment(data.enlistStart), moment(data.enlistEnd)])
55
+      // setSignupTime([moment(data.enlistStart), moment(data.enlistEnd)])
56
       setData(data)
56
       setData(data)
57
       setIsEnlist(data.isEnlist)
57
       setIsEnlist(data.isEnlist)
58
       setActivityStatus(data.activityStatus)
58
       setActivityStatus(data.activityStatus)
68
       getDynamicData(dynamicId);
68
       getDynamicData(dynamicId);
69
     }
69
     }
70
   }, [])
70
   }, [])
71
+  const checkTime = () => {
72
+    function compareDate(dateTime1, dateTime2) {
73
+      var formatDate1 = new Date(dateTime1)
74
+      var formatDate2 = new Date(dateTime2)
75
+      if (formatDate1 > formatDate2) {
76
+        return true;
77
+      }
78
+      else {
79
+        return false;
80
+      }
81
+    }
82
+    // 1)修改后的开始时间不得大于当前时间(会存在已经成功报名的用户)
83
+
84
+    // (2)修改后开始时间<当前时间<修改后结束时间:活动进行中
85
+
86
+    // (3)修改后结束时间<当前时间:活动已结束
87
+    if (showSignupTime[0]) {
88
+      const date = data.signupTime
89
+      const nowDate = new Date()
90
+      console.log(compareDate(nowDate, showSignupTime[0]))
91
+      if (compareDate(nowDate, showSignupTime[0])) {
92
+        return true
93
+      } else {
94
+        return '修改后的开始时间不得大于当前时间(会存在已经成功报名的用户)'
95
+      }
96
+    }
97
+    return true
98
+  }
99
+
71
 
100
 
72
   const handleSubmit = e => {
101
   const handleSubmit = e => {
73
     e.preventDefault();
102
     e.preventDefault();
74
     props.form.validateFields((err, values) => {
103
     props.form.validateFields((err, values) => {
104
+
75
       if (!err) {
105
       if (!err) {
76
         console.log('Received values of form: ', values);
106
         console.log('Received values of form: ', values);
77
         const { activityTime, signupTime } = values
107
         const { activityTime, signupTime } = values
86
 
116
 
87
         console.log('submit data --->', values)
117
         console.log('submit data --->', values)
88
         if (dynamicId) {
118
         if (dynamicId) {
119
+          const checks = checkTime()
120
+          if (checks != true) {
121
+            message.info(checks)
122
+            return
123
+          }
124
+          console.log(data.count,values.personNum)
125
+          if (data.count || 0 > values.personNum) {
126
+            message.info('活动人数必须大于已报名人数')
127
+            return
128
+          }
129
+
89
           values.dynamicId = dynamicId
130
           values.dynamicId = dynamicId
90
           request({ ...apis.activity.update, data: values }).then(data => {
131
           request({ ...apis.activity.update, data: values }).then(data => {
91
             message.info('保存成功')
132
             message.info('保存成功')
110
       }
151
       }
111
     });
152
     });
112
   }
153
   }
113
-  const checkTime = (value,data) => {
114
-    console.log(value,data,'-----checkTime---------')
115
-    console.log(props.form.getFieldsValue(),'--------time1-----------')
154
+  const changeTime = (value, date) => {
155
+    // console.log(value, data, '-----checkTime---------')
156
+    // console.log(props.form.getFieldsValue(), '--------time1-----------')
157
+    // let datas = data
158
+    // console.log(value, date, datas)
159
+    // datas.signupTime = date
160
+
161
+    // //   data.signupTime = [moment(data.enlistStart), moment(data.enlistEnd)]
162
+
163
+    // console.log(datas,'-------datas--------')
164
+    //   props.form.setFieldsValue(data)
165
+    setShowSignupTime(date)
166
+    // props.form.setFieldsValue(datas)
167
+    // // form.setFieldsValue
168
+    // console.log('-------1--------')
116
   }
169
   }
117
-  
118
 
170
 
119
-  function validator(rule, value, callback){
120
-    // try {
121
-    //   throw new Error('Something wrong!');
122
-    // } catch (err) {
123
-    //   callback(err);
124
-    // }
125
-
126
-    console.log(rule,value,'--------time-----------')
127
-    console.log(props.form.getFieldsValue(),'--------time1-----------')
128
-
129
-  //   props.form.validateFields((err, values) => {
130
-  //     console.log(values,'--------values-----------')
131
-  //   })
132
-  // //   setTimeout(()=>{
133
-  // //     props.form.setFieldsValue({
134
-  // //         'buildingArea': buildingData.buildingArea
135
-  // //     })
136
-  // // },0)
137
-  //   setTimeout(
138
-  //    ()=>{console.log(props.form.getFieldsValue(),'--------time2-----------')} 
139
-  //   ,10000)
140
-    // props.form.validateFields((err, values) => {
141
-    //   console.log(values,'--------time2-----------')
142
-    // })
143
-    return false
171
+  function disabledDate(current) {
172
+    // Can not select days before today and today
173
+    return current && current > moment().endOf('day');
174
+  }
175
+  
176
+  // function disabledDateTime() {
177
+  //   return {
178
+  //     disabledHours: () => range(0, 24).splice(4, 20),
179
+  //     disabledMinutes: () => range(30, 60),
180
+  //     disabledSeconds: () => [55, 56],
181
+  //   };
182
+  // }
183
+  
184
+  function disabledRangeTime(_, type) {
185
+    if (type === 'start') {
186
+      return {
187
+        disabledHours: () => range(0, 60).splice(4, 20),
188
+        disabledMinutes: () => range(30, 60),
189
+        disabledSeconds: () => [55, 56],
190
+      };
191
+    }
192
+    return 
144
   }
193
   }
145
 
194
 
146
   const { getFieldDecorator } = props.form;
195
   const { getFieldDecorator } = props.form;
205
                 message: '请选择活动时间',
254
                 message: '请选择活动时间',
206
               },
255
               },
207
             ],
256
             ],
208
-          })(<RangePicker format="YYYY-MM-DD HH:mm"  />)}
257
+          })(<RangePicker format="YYYY-MM-DD HH:mm" />)}
209
         </Form.Item>
258
         </Form.Item>
210
         <Form.Item label="活动地点">
259
         <Form.Item label="活动地点">
211
           {getFieldDecorator('address', {
260
           {getFieldDecorator('address', {
215
                 message: '请输入活动地点',
264
                 message: '请输入活动地点',
216
               },
265
               },
217
             ],
266
             ],
218
-          })(<Input  />)}
267
+          })(<Input />)}
219
         </Form.Item>
268
         </Form.Item>
220
         {/* disabled={activityStatus === 0 ? true : false} */}
269
         {/* disabled={activityStatus === 0 ? true : false} */}
221
         <Form.Item label="活动人数" help="当前活动最多可报名人数">
270
         <Form.Item label="活动人数" help="当前活动最多可报名人数">
225
                 required: true,
274
                 required: true,
226
                 message: '请输入活动人数',
275
                 message: '请输入活动人数',
227
               },
276
               },
277
+              // {
278
+              //   min: data.personNum,min={data.personNum || 0}
279
+              //   message: '活动人数必须大于已报名人数',
280
+              // },
228
             ],
281
             ],
229
-          })(<Input type="number" min = {data.personNum||0} />)}
282
+          })(<Input type="number"   />)}
230
         </Form.Item>
283
         </Form.Item>
231
         <Form.Item label="用户携带人数" help="每个用户最多可携带参与活动的人数">
284
         <Form.Item label="用户携带人数" help="每个用户最多可携带参与活动的人数">
232
           {getFieldDecorator('maxEnlistByPerson', {
285
           {getFieldDecorator('maxEnlistByPerson', {
236
                 message: '请输入用户携带人数',
289
                 message: '请输入用户携带人数',
237
               },
290
               },
238
             ],
291
             ],
239
-          })(<Input type="number" min={1}  />)}
292
+          })(<Input type="number" min={1} />)}
240
         </Form.Item>
293
         </Form.Item>
241
         <Form.Item label="活动详情">
294
         <Form.Item label="活动详情">
242
           {getFieldDecorator('desc')(<Wangedit />)}
295
           {getFieldDecorator('desc')(<Wangedit />)}
243
         </Form.Item>
296
         </Form.Item>
244
         <Form.Item label="报名时间">
297
         <Form.Item label="报名时间">
245
           {getFieldDecorator('signupTime', {
298
           {getFieldDecorator('signupTime', {
246
-            initialValue:signupTime,
247
-            //  trigger:checkTime(),
248
             rules: [
299
             rules: [
249
               {
300
               {
250
                 required: true,
301
                 required: true,
251
                 message: '请选择报名时间',
302
                 message: '请选择报名时间',
252
               },
303
               },
253
-              // {
254
-              //   validator,
255
-              //   message: '请选择报名时间',
256
-              // },
257
             ],
304
             ],
258
-          })(<RangePicker format="YYYY-MM-DD HH:mm"  onChange={checkTime}  />)}
305
+          })(<RangePicker format="YYYY-MM-DD HH:mm" disabledDate={disabledDate}  disabledTime={disabledRangeTime} onChange={changeTime} />)}
259
         </Form.Item>
306
         </Form.Item>
260
         <Form.Item label="权重">
307
         <Form.Item label="权重">
261
           {getFieldDecorator('heavy', {
308
           {getFieldDecorator('heavy', {
262
-           
309
+
263
             rules: [
310
             rules: [
264
               {
311
               {
265
                 required: true,
312
                 required: true,

+ 19
- 1
src/pages/activity/groupActivity/editGroupActivity.jsx 查看文件

123
         name: 'activityTime',
123
         name: 'activityTime',
124
         type: FieldTypes.RangePicker,
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,
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 },
126
+        props: { showTime: { format: 'HH:mm' } },
127
         rules: [
127
         rules: [
128
           { required: true, message: '请选择活动时间' },
128
           { required: true, message: '请选择活动时间' },
129
         ],
129
         ],
173
       },
173
       },
174
     ]
174
     ]
175
 
175
 
176
+    function compareDate(dateTime1, dateTime2) {
177
+      var formatDate1 = new Date(dateTime1)
178
+      var formatDate2 = new Date(dateTime2)
179
+      if (formatDate1 > formatDate2) {
180
+        return true;
181
+      }
182
+      else {
183
+        return false;
184
+      }
185
+    }
186
+
176
     const handleSubmit = val => {
187
     const handleSubmit = val => {
177
       const { activityTime, signupTime, ...submitValue } = val
188
       const { activityTime, signupTime, ...submitValue } = val
178
       console.log('val', val)
189
       console.log('val', val)
181
       submitValue.endTime = moment(endTime).format('YYYY-MM-DD HH:mm');
192
       submitValue.endTime = moment(endTime).format('YYYY-MM-DD HH:mm');
182
       console.log('submit data --->', submitValue)
193
       console.log('submit data --->', submitValue)
183
       if (groupActivityId) {
194
       if (groupActivityId) {
195
+
196
+        const nowDate = new Date()
197
+        if (!compareDate(nowDate, startTime)) {
198
+
199
+          message.info("修改后的开始时间不得大于当前时间(会存在已经成功助力或者发起助力的用户)")
200
+          return
201
+        }
184
         submitValue.groupActivityId = groupActivityId
202
         submitValue.groupActivityId = groupActivityId
185
         request({ ...apis.groupActivity.update, data: submitValue }).then((data) => {
203
         request({ ...apis.groupActivity.update, data: submitValue }).then((data) => {
186
           message.info("保存成功")
204
           message.info("保存成功")

+ 156
- 137
src/pages/activity/helpActivity/edithelpActivity.jsx 查看文件

47
   const [dynamicData, setDynamicData] = useState({ isEnlist: 1 })
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
   // function addChannel(params) {
72
   // function addChannel(params) {
73
   //   request({ ...apis.channelList.addChannel, data: { ...params } }).then((data) => {
73
   //   request({ ...apis.channelList.addChannel, data: { ...params } }).then((data) => {
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
   function handleSubmit(e) {
92
   function handleSubmit(e) {
82
     e.preventDefault();
93
     e.preventDefault();
83
     props.form.validateFields((err, values) => {
94
     props.form.validateFields((err, values) => {
91
           message.error('助力邀请人数不能超过200')
102
           message.error('助力邀请人数不能超过200')
92
           return
103
           return
93
         }
104
         }
94
-          // 助力邀请人数>0
105
+        // 助力邀请人数>0
95
         if (values.personNum <= 0) {
106
         if (values.personNum <= 0) {
96
           message.error('助力邀请人数大于0')
107
           message.error('助力邀请人数大于0')
97
           return
108
           return
99
 
110
 
100
         // 判断助力人数必须大于0
111
         // 判断助力人数必须大于0
101
         if (values.isEnlist === 1) {
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
         const { activityTime, signupTime, ...submitValue } = values
118
         const { activityTime, signupTime, ...submitValue } = values
108
         const [startDate, endDate] = activityTime
119
         const [startDate, endDate] = activityTime
109
         console.log('startDate', activityTime)
120
         console.log('startDate', activityTime)
114
         // submitValue.enlistEnd = moment(enlistEnd).format('YYYY-MM-DD HH:mm');
125
         // submitValue.enlistEnd = moment(enlistEnd).format('YYYY-MM-DD HH:mm');
115
         console.log('submit data --->', submitValue)
126
         console.log('submit data --->', submitValue)
116
         if (helpActivityId) {
127
         if (helpActivityId) {
128
+
129
+          const nowDate = new Date()
130
+          if (!compareDate(nowDate, startDate)) {
131
+
132
+            message.info("修改后的开始时间不得大于当前时间(会存在已经成功助力或者发起助力的用户)")
133
+            return
134
+          }
135
+
117
           submitValue.helpActivityId = helpActivityId
136
           submitValue.helpActivityId = helpActivityId
118
           request({ ...apis.helpActivity.update, data: submitValue }).then((data) => {
137
           request({ ...apis.helpActivity.update, data: submitValue }).then((data) => {
119
             message.info("保存成功")
138
             message.info("保存成功")
145
     <>
164
     <>
146
       <Form labelCol={{ span: 7 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
165
       <Form labelCol={{ span: 7 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
147
         <Form.Item label="所属项目">
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
         </Form.Item>
175
         </Form.Item>
157
 
176
 
158
         <Form.Item label="活动标题">
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
         </Form.Item>
186
         </Form.Item>
168
 
187
 
169
         <Form.Item label="助力详情主图" help="建议图片尺寸:750*600px,比例5:4,格式:jpg,用于:助力活动详情">
188
         <Form.Item label="助力详情主图" help="建议图片尺寸:750*600px,比例5:4,格式:jpg,用于:助力活动详情">
170
           {getFieldDecorator('img', {
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
         </Form.Item>
197
         </Form.Item>
179
 
198
 
180
         <Form.Item label="助力封面图1" help="建议图片尺寸:750*420px,比例16:9,格式:jpg,用于:活动列表/首页推荐">
199
         <Form.Item label="助力封面图1" help="建议图片尺寸:750*420px,比例16:9,格式:jpg,用于:活动列表/首页推荐">
181
           {getFieldDecorator('listImg', {
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
         </Form.Item>
208
         </Form.Item>
190
 
209
 
191
         <Form.Item label="助力封面图2" help="建议图片尺寸:750*250px,比例3:1,格式:jpg,用于:项目详情页">
210
         <Form.Item label="助力封面图2" help="建议图片尺寸:750*250px,比例3:1,格式:jpg,用于:项目详情页">
192
           {getFieldDecorator('bannerListImg', {
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
         </Form.Item>
219
         </Form.Item>
201
 
220
 
202
         <Form.Item label="活动时间">
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
         </Form.Item>
230
         </Form.Item>
212
 
231
 
213
         <Form.Item label="助力邀请人数" min={1} max={10}>
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
         </Form.Item>
241
         </Form.Item>
223
 
242
 
224
         <Form.Item label="助力次数">
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
         </Form.Item>
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
         <Form.Item label="活动说明" help="建议宽度:750px,高度不限,格式:jpg,用于活动详情">
271
         <Form.Item label="活动说明" help="建议宽度:750px,高度不限,格式:jpg,用于活动详情">
253
           {getFieldDecorator('activityInstructions', {
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
         <Form.Item label="权重">
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
         </Form.Item>
290
         </Form.Item>
272
         <Form.Item wrapperCol={{ span: 12, offset: 8 }}>
291
         <Form.Item wrapperCol={{ span: 12, offset: 8 }}>
273
           <Button type="primary" htmlType="submit">
292
           <Button type="primary" htmlType="submit">
277
           <Button onClick={() => cancelPage()}>
296
           <Button onClick={() => cancelPage()}>
278
             取消
297
             取消
279
           </Button>
298
           </Button>
280
-          </Form.Item>
299
+        </Form.Item>
281
       </Form>
300
       </Form>
282
     </>
301
     </>
283
   )
302
   )
298
   const { helpActivityId } = props.location.query
317
   const { helpActivityId } = props.location.query
299
   const [dynamicData, setDynamicData] = useState({ isEnlist: 1 })
318
   const [dynamicData, setDynamicData] = useState({ isEnlist: 1 })
300
 
319
 
301
-    // eslint-disable-next-line react-hooks/rules-of-hooks
302
-    useEffect(() => {
303
-      // eslint-disable-next-line no-use-before-define
304
-      if (helpActivityId) {
320
+  // eslint-disable-next-line react-hooks/rules-of-hooks
321
+  useEffect(() => {
322
+    // eslint-disable-next-line no-use-before-define
323
+    if (helpActivityId) {
305
       getDynamicData(helpActivityId);
324
       getDynamicData(helpActivityId);
306
     }
325
     }
307
-    }, [])
326
+  }, [])
327
+
328
+  // 详情
329
+  const getDynamicData = (helpActivityId) => {
330
+    request({ ...apis.helpActivity.details, params: { helpActivityId } }).then((data) => {
331
+      console.log(data)
332
+      setDynamicData(data)
333
+    })
334
+  }
308
 
335
 
309
-    // 详情
310
-    const getDynamicData = (helpActivityId) => {
311
-      request({ ...apis.helpActivity.details, params: { helpActivityId } }).then((data) => {
312
-        console.log(data)
313
-        setDynamicData(data)
314
-      })
315
-    }
316
-  
317
   const radioOnChange = e => {
336
   const radioOnChange = e => {
318
     console.log(e.target.value)
337
     console.log(e.target.value)
319
     setDynamicData({ ...dynamicData, isEnlist: e.target.value })
338
     setDynamicData({ ...dynamicData, isEnlist: e.target.value })
341
         })
360
         })
342
         getMiniappName()
361
         getMiniappName()
343
       }, [])
362
       }, [])
344
-    }else{
363
+    } else {
345
       getMiniappName()
364
       getMiniappName()
346
     }
365
     }
347
     // 获取小程序名称
366
     // 获取小程序名称
417
             <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>助力海报图</p>
436
             <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>助力海报图</p>
418
             <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
437
             <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
419
           </div>
438
           </div>
420
-          <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于助力活动海报</p>
439
+          <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' }}>
440
           <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>
441
             <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)} />
442
             <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
495
         <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>助力分享图</p>
514
         <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>助力分享图</p>
496
         <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
515
         <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
497
       </div>
516
       </div>
498
-      <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于助力活动分享好友</p>
517
+      <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>
518
       <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
500
       <Button onClick={() => cancelPage()}>取消</Button>
519
       <Button onClick={() => cancelPage()}>取消</Button>
501
     </div>
520
     </div>
511
         </Radio.Group>
530
         </Radio.Group>
512
       </div>
531
       </div>
513
       <div>
532
       <div>
514
-        {tab === 'basic' && <Basic helpActivityId={helpActivityId}/>}
533
+        {tab === 'basic' && <Basic helpActivityId={helpActivityId} />}
515
         {tab === 'poster' && <Poster />}
534
         {tab === 'poster' && <Poster />}
516
         {tab === 'share' && <Share />}
535
         {tab === 'share' && <Share />}
517
       </div>
536
       </div>

+ 7
- 7
src/pages/channel/brokerList.jsx 查看文件

1
 import React, { useState, useEffect } from 'react';
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
 import { FormattedMessage } from 'umi-plugin-react/locale';
3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4
 import channels from './channelList.less';
4
 import channels from './channelList.less';
5
 import router from 'umi/router';
5
 import router from 'umi/router';
36
     align: 'center',
36
     align: 'center',
37
 
37
 
38
     // eslint-disable-next-line jsx-a11y/alt-text
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
     title: '用户姓名',
42
     title: '用户姓名',
43
-    dataIndex: 'name',
44
-    key: 'name',
43
+    dataIndex: 'nickname',
44
+    key: 'nickname',
45
     align: 'center',
45
     align: 'center',
46
   },
46
   },
47
   {
47
   {
48
     title: '电话',
48
     title: '电话',
49
-    dataIndex: 'tel',
50
-    key: 'tel',
49
+    dataIndex: 'phone',
50
+    key: 'phone',
51
     align: 'center',
51
     align: 'center',
52
   },
52
   },
53
   {
53
   {
55
     dataIndex: 'sex',
55
     dataIndex: 'sex',
56
     key: 'sex',
56
     key: 'sex',
57
     align: 'center',
57
     align: 'center',
58
-    render: (text, list) => <a>{list.gender === '1' ? '男' : '女'}</a>,
58
+    render: (text, list) => <a>{list.gender === '1' ? '男' : list.gender === '2' ? '女':'未知'}</a>,
59
   },
59
   },
60
   {
60
   {
61
     title: '推荐客户',
61
     title: '推荐客户',

+ 2
- 2
src/pages/channel/independentList/index.jsx 查看文件

390
       title: '类型',
390
       title: '类型',
391
       dataIndex: 'personType',
391
       dataIndex: 'personType',
392
       key: 'personType',
392
       key: 'personType',
393
-      render: (_, record) => <><span>{record.personType === 'channel agent' ? '渠道经纪人' : '独立经纪人'}</span></>,
393
+      render: (_, record) => <><span>{record.personType === 'channel agent' ? '专业经纪人' : '专业经纪人'}</span></>,
394
     },
394
     },
395
     {
395
     {
396
       title: '所属渠道',
396
       title: '所属渠道',
397
       dataIndex: 'channelName',
397
       dataIndex: 'channelName',
398
       key: 'channelName',
398
       key: 'channelName',
399
-      render: (_, record) => <><span>{record.personType === 'channel agent' ? record.channelName : ''}</span></>,
399
+      render: (_, record) => <><span>{record.channelName }</span></>,
400
     },
400
     },
401
     {
401
     {
402
       title: '操作',
402
       title: '操作',

+ 2
- 2
src/pages/channel/recommendClients.jsx 查看文件

1
 import React, { useState, useEffect } from 'react';
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
 import { FormattedMessage } from 'umi-plugin-react/locale';
3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4
 import channels from './channelList.less';
4
 import channels from './channelList.less';
5
 import router from 'umi/router';
5
 import router from 'umi/router';
52
     // key: 'img',
52
     // key: 'img',
53
     align: 'center',
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
     title: '用户姓名',
58
     title: '用户姓名',