dingxin 5 年之前
父節點
當前提交
2a042ad4b7
共有 2 個文件被更改,包括 19 次插入10 次删除
  1. 5
    5
      src/pages/activity/helpActivity/edithelpActivity.jsx
  2. 14
    5
      src/pages/activity/helpActivity/list.jsx

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

@@ -206,13 +206,13 @@ const Edit = props => {
206 206
     const submitPoster = () => {
207 207
       if (helpActivityId) {
208 208
         if (posterId) {
209
-          request({ ...apis.activity.updatePoster, urlData: { id: posterId }, data: { targetId: helpActivityId, targetType: 'helPactivity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
209
+          request({ ...apis.activity.updatePoster, urlData: { id: posterId }, data: { targetId: helpActivityId, targetType: 'helpActivity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
210 210
             message.info("保存成功")
211 211
           }).catch((err) => {
212 212
             message.info(err.msg || err.message)
213 213
           })
214 214
         } else {
215
-          request({ ...apis.activity.addPoster, data: { targetId: helpActivityId, targetType: 'helPactivity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
215
+          request({ ...apis.activity.addPoster, data: { targetId: helpActivityId, targetType: 'helpActivity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
216 216
             setPosterId(data.posterId)
217 217
             message.info("保存成功")
218 218
           }).catch((err) => {
@@ -293,7 +293,7 @@ const Edit = props => {
293 293
 
294 294
     if (helpActivityId) {
295 295
       useEffect(() => {
296
-        request({ ...apis.activity.shareContent, params: { targetId: helpActivityId, targetType: 'helPactivity' }, }).then((data) => {
296
+        request({ ...apis.activity.shareContent, params: { targetId: helpActivityId, targetType: 'helpActivity' }, }).then((data) => {
297 297
           console.log(data, "2222")
298 298
           if (data.length > 0) {
299 299
             setShareContentId(data[0].shareContentId)
@@ -309,13 +309,13 @@ const Edit = props => {
309 309
     const submitShare = () => {
310 310
       if (helpActivityId) {
311 311
         if (shareContentId) {
312
-          request({ ...apis.activity.updateShareContent, urlData: { id: shareContentId }, data: { targetId: helpActivityId, shareContentType: 'helPactivity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
312
+          request({ ...apis.activity.updateShareContent, urlData: { id: shareContentId }, data: { targetId: helpActivityId, shareContentType: 'helpActivity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
313 313
             message.info("保存成功")
314 314
           }).catch((err) => {
315 315
             message.info(err.msg || err.message)
316 316
           })
317 317
         } else {
318
-          request({ ...apis.activity.addShareContent, data: { targetId: helpActivityId, shareContentType: 'helPactivity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
318
+          request({ ...apis.activity.addShareContent, data: { targetId: helpActivityId, shareContentType: 'helpActivity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
319 319
             setShareContentId(data.shareContentId)
320 320
             message.info("保存成功")
321 321
           }).catch((err) => {

+ 14
- 5
src/pages/activity/helpActivity/list.jsx 查看文件

@@ -59,7 +59,7 @@ const toEditGoods = (helpActivityId) => () => {
59 59
       dataIndex: 'startDate',
60 60
       key: 'startDate',
61 61
       align: 'center',
62
-      render: (x, row) => <><span>{`${moment(row.startDate).format('YYYY-MM-DD')} —— ${moment(row.endDate).format('YYYY-MM-DD')}`}</span></>
62
+      render: (x, row) => <><span>{`${moment(row.startDate).format('YYYY-MM-DD HH:mm')} —— ${moment(row.endDate).format('YYYY-MM-DD HH:mm')}`}</span></>,
63 63
     },
64 64
     {
65 65
       title: '已参加人数',
@@ -197,6 +197,10 @@ const toEditGoods = (helpActivityId) => () => {
197 197
 const handleSubmit = (e, props) => {
198 198
     e.preventDefault();
199 199
     props.form.validateFields((err, values) => {
200
+      console.log('values', values)
201
+      const startDate = moment(values.startTime).format('YYYY-MM-DD HH:mm');
202
+      const endDate = moment(values.endTime).format('YYYY-MM-DD HH:mm');
203
+      console.log('startDate', startDate)
200 204
       if (!err) {
201 205
         console.log('提交数据: ', values)
202 206
         getList({ pageNum: 1, pageSize: 10, ...values })
@@ -233,11 +237,16 @@ const handleSubmit = (e, props) => {
233 237
             />,
234 238
           )}
235 239
         </Form.Item>
236
-        {/* <Form.Item>
237
-          {getFieldDecorator('time')(
238
-            <DatePicker />
240
+        <Form.Item>
241
+          {getFieldDecorator('startTime')(
242
+            <DatePicker placeholder="活动开始时间"/>,
239 243
           )}
240
-        </Form.Item> */}
244
+        </Form.Item>
245
+        <Form.Item>
246
+          {getFieldDecorator('endTime')(
247
+            <DatePicker placeholder="活动结束时间"/>,
248
+          )}
249
+        </Form.Item>
241 250
         <Form.Item>
242 251
           {getFieldDecorator('activityStatus')(
243 252
             <Select style={{ width: '180px' }} placeholder="活动状态">