weiximei 5 years ago
parent
commit
d2acc735a4

+ 14
- 9
src/pages/activity/editActivity.jsx View File

25
   wrapperCol: { span: 14 },
25
   wrapperCol: { span: 14 },
26
 };
26
 };
27
 
27
 
28
+const cancelPage = () => {
29
+  router.push({
30
+    pathname: '/activity/ActivityList',
31
+  });
32
+}
33
+
28
 const BasicForm = props => {
34
 const BasicForm = props => {
29
   const [isEnlist, setIsEnlist] = useState(1)
35
   const [isEnlist, setIsEnlist] = useState(1)
30
   const [activityStatus, setActivityStatus] = useState(1)
36
   const [activityStatus, setActivityStatus] = useState(1)
222
             确认
228
             确认
223
           </Button>
229
           </Button>
224
           &nbsp;&nbsp;&nbsp;&nbsp;
230
           &nbsp;&nbsp;&nbsp;&nbsp;
225
-          <Button onClick={() => router.go(-1)}>
231
+          <Button onClick={() => cancelPage()}>
226
             取消
232
             取消
227
           </Button>
233
           </Button>
228
         </Form.Item>
234
         </Form.Item>
242
 const Edit = props => {
248
 const Edit = props => {
243
   const [tab, changeTab] = useState('basic')
249
   const [tab, changeTab] = useState('basic')
244
   const { dynamicId } = props.location.query
250
   const { dynamicId } = props.location.query
245
-  
246
-  const cancelPage = () => {
247
-    router.push({
248
-      pathname: '/activity/ActivityList',
249
-    });
250
-  }
251
+
251
 
252
 
252
   const Poster = (props) => {
253
   const Poster = (props) => {
253
     const [inputValue, changeInput] = useState('')
254
     const [inputValue, changeInput] = useState('')
369
         </div>
370
         </div>
370
       </div>
371
       </div>
371
       <Button type="primary" onClick={submitPoster} style={{ margin: '40px 40px 40px 30vw' }}> 确定</Button>
372
       <Button type="primary" onClick={submitPoster} style={{ margin: '40px 40px 40px 30vw' }}> 确定</Button>
372
-      <Button onClick={() => router.go(-1)}>取消</Button>
373
+      <Button onClick={() => cancelPage()}>
374
+        取消
375
+      </Button>
373
     </div>
376
     </div>
374
 
377
 
375
   }
378
   }
436
       </div>
439
       </div>
437
       <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginTop: '20px' }}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于活动分享好友</p>
440
       <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginTop: '20px' }}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于活动分享好友</p>
438
       <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
441
       <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
439
-      <Button onClick={() => router.go(-1)}>取消</Button>
442
+      <Button onClick={() => cancelPage()}>
443
+        取消
444
+      </Button>
440
     </div>
445
     </div>
441
   }
446
   }
442
 
447
 

+ 8
- 7
src/pages/activity/groupActivity/editGroupActivity.jsx View File

20
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
20
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
21
 const { TextArea } = Input;
21
 const { TextArea } = Input;
22
 
22
 
23
+const cancelPage = () => {
24
+  router.push({
25
+    pathname: '/activity/groupActivity/list',
26
+  });
27
+}
28
+
23
 /**
29
 /**
24
  *
30
  *
25
  *
31
  *
56
       })
62
       })
57
   }
63
   }
58
 
64
 
59
-  const cancelPage = () => {
60
-    router.push({
61
-      pathname: '/activity/groupActivity/list',
62
-    });
63
-  }
64
   const radioOnChange = e => {
65
   const radioOnChange = e => {
65
     console.log(e.target.value)
66
     console.log(e.target.value)
66
     setDynamicData({ ...dynamicData, isEnlist: e.target.value })
67
     setDynamicData({ ...dynamicData, isEnlist: e.target.value })
315
         </div>
316
         </div>
316
       </div>
317
       </div>
317
       <Button type="primary" onClick={submitPoster} style={{ margin: '40px 40px 40px 30vw' }}> 确定</Button>
318
       <Button type="primary" onClick={submitPoster} style={{ margin: '40px 40px 40px 30vw' }}> 确定</Button>
318
-      <Button onClick={() => router.go(-1)}>取消</Button>
319
+      <Button onClick={() => cancelPage()}>取消</Button>
319
     </div>
320
     </div>
320
 
321
 
321
   }
322
   }
382
       </div>
383
       </div>
383
       <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于拼团活动分享好友</p>
384
       <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于拼团活动分享好友</p>
384
       <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
385
       <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
385
-      <Button onClick={() => router.go(-1)}>取消</Button>
386
+      <Button onClick={() => cancelPage()}>取消</Button>
386
     </div>
387
     </div>
387
   }
388
   }
388
 
389
 

+ 9
- 16
src/pages/activity/helpActivity/edithelpActivity.jsx View File

20
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
20
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
21
 const { TextArea } = Input;
21
 const { TextArea } = Input;
22
 
22
 
23
+const cancelPage = () => {
24
+  router.push({
25
+    pathname: '/activity/helpActivity/list',
26
+  });
27
+}
28
+
23
 const header = props => {
29
 const header = props => {
24
   const [isEnlist, setIsEnlist] = useState(1)
30
   const [isEnlist, setIsEnlist] = useState(1)
25
   // 新增成功后拿到返回的ID
31
   // 新增成功后拿到返回的ID
71
   // })
77
   // })
72
   // }
78
   // }
73
 
79
 
74
-  
75
-  const cancelPage = () => {
76
-    router.push({
77
-      pathname: '/activity/helpActivity/list',
78
-    });
79
-  }
80
-
81
   function handleSubmit(e) {
80
   function handleSubmit(e) {
82
     e.preventDefault();
81
     e.preventDefault();
83
     props.form.validateFields((err, values) => {
82
     props.form.validateFields((err, values) => {
274
             确认
273
             确认
275
           </Button>
274
           </Button>
276
           &nbsp;&nbsp;&nbsp;&nbsp;
275
           &nbsp;&nbsp;&nbsp;&nbsp;
277
-          <Button onClick={() => router.go(-1)}>
276
+          <Button onClick={() => cancelPage()}>
278
             取消
277
             取消
279
           </Button>
278
           </Button>
280
           </Form.Item>
279
           </Form.Item>
314
       })
313
       })
315
     }
314
     }
316
   
315
   
317
-
318
-  const cancelPage = () => {
319
-    router.push({
320
-      pathname: '/activity/helpActivity/list',
321
-    });
322
-  }
323
   const radioOnChange = e => {
316
   const radioOnChange = e => {
324
     console.log(e.target.value)
317
     console.log(e.target.value)
325
     setDynamicData({ ...dynamicData, isEnlist: e.target.value })
318
     setDynamicData({ ...dynamicData, isEnlist: e.target.value })
436
         </div>
429
         </div>
437
       </div>
430
       </div>
438
       <Button type="primary" onClick={submitPoster} style={{ margin: '40px 40px 40px 30vw' }}> 确定</Button>
431
       <Button type="primary" onClick={submitPoster} style={{ margin: '40px 40px 40px 30vw' }}> 确定</Button>
439
-      <Button onClick={() => router.go(-1)}>取消</Button>
432
+      <Button onClick={() => cancelPage()}>取消</Button>
440
     </div>
433
     </div>
441
 
434
 
442
   }
435
   }
503
       </div>
496
       </div>
504
       <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于助力活动分享好友</p>
497
       <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于助力活动分享好友</p>
505
       <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
498
       <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
506
-      <Button onClick={() => router.go(-1)}>取消</Button>
499
+      <Button onClick={() => cancelPage()}>取消</Button>
507
     </div>
500
     </div>
508
   }
501
   }
509
 
502