傅行帆 5 years ago
parent
commit
bfa16f7276
2 changed files with 27 additions and 29 deletions
  1. 6
    5
      src/pages/activity/ActivityList.jsx
  2. 21
    24
      src/pages/activity/editActivity.jsx

+ 6
- 5
src/pages/activity/ActivityList.jsx View File

34
 
34
 
35
   
35
   
36
 // 跳转到编辑商品
36
 // 跳转到编辑商品
37
-const toEditGoods = (dynamicId) => {
37
+const toEditGoods = (dynamicId) => () => {
38
     router.push({
38
     router.push({
39
       pathname: '/activity/editActivity',
39
       pathname: '/activity/editActivity',
40
       query: {
40
       query: {
103
       render: (x,row) => <><span style={{ color: '#1990FF'}} onClick={getSignList.bind(this, row.dynamicId)}>{row.isEnlist == '1' || row.isEnlist == '2' ? "报名记录" : ""}<Icon type="snippets" className={styles.shoppingCart} /></span>
103
       render: (x,row) => <><span style={{ color: '#1990FF'}} onClick={getSignList.bind(this, row.dynamicId)}>{row.isEnlist == '1' || row.isEnlist == '2' ? "报名记录" : ""}<Icon type="snippets" className={styles.shoppingCart} /></span>
104
                            <span style={{ color: '#1990FF' }} onClick={sendOrPublicDynamic.bind(this,row)}>{ row.status === 1 ? '取消发布' : '发布' }<Icon type="close-circle" className={styles.edit} /></span>
104
                            <span style={{ color: '#1990FF' }} onClick={sendOrPublicDynamic.bind(this,row)}>{ row.status === 1 ? '取消发布' : '发布' }<Icon type="close-circle" className={styles.edit} /></span>
105
                            <span style={{ color: '#1990FF' }} onClick={finishDynamic.bind(this,row)}>结束活动<Icon type="poweroff" className={styles.edit} /></span>
105
                            <span style={{ color: '#1990FF' }} onClick={finishDynamic.bind(this,row)}>结束活动<Icon type="poweroff" className={styles.edit} /></span>
106
-                           <span style={{ color: '#1990FF', marginRight: '20px' }} onClick={topDynamic.bind(this,row)}>{ row.weight === 1 ? '取消置顶' : '置顶' }<Icon type="vertical-align-top" className={styles.edit} /></span>
107
-                           <span style={{ color: '#FF925C' }} onClick={toEditGoods.bind(this, row.dynamicId)}>编辑<Icon type="form" className={styles.edit} /></span>
106
+                           <span style={{ color: '#1990FF', marginRight: '20px' }} onClick={topDynamic(row)}>{ row.weight === 1 ? '取消置顶' : '置顶' }<Icon type="vertical-align-top" className={styles.edit} /></span>
107
+                           <span style={{ color: '#FF925C' }} onClick={toEditGoods(row.dynamicId)}>编辑<Icon type="form" className={styles.edit} /></span>
108
                          </>
108
                          </>
109
     },
109
     },
110
   ];
110
   ];
140
         });
140
         });
141
   }
141
   }
142
   
142
   
143
-  const topDynamic = (row) => {
143
+//   置顶
144
+  const topDynamic = (row) => () => {
144
       const weight = Math.abs(row.weight - 1)
145
       const weight = Math.abs(row.weight - 1)
145
       request({
146
       request({
146
           url: '/api/admin/buildingDynamic/weight',
147
           url: '/api/admin/buildingDynamic/weight',
249
           </Button>
250
           </Button>
250
         </Form.Item>
251
         </Form.Item>
251
       </Form>
252
       </Form>
252
-      <Button type="primary" className={styles.addBtn} onClick={toEditGoods}>新增</Button>
253
+      <Button type="primary" className={styles.addBtn} onClick={toEditGoods()}>新增</Button>
253
       <Table dataSource={data.list} columns={columns} pagination={false}/>
254
       <Table dataSource={data.list} columns={columns} pagination={false}/>
254
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
255
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
255
         <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} />
256
         <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} />

+ 21
- 24
src/pages/activity/editActivity.jsx View File

3
 import { FormattedMessage } from 'umi-plugin-react/locale';
3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4
 import styles from '../style/GoodsList.less';
4
 import styles from '../style/GoodsList.less';
5
 
5
 
6
-
7
-
8
 /**
6
 /**
9
  *
7
  *
10
  *
8
  *
11
  * @param {*} props
9
  * @param {*} props
12
  * @returns
10
  * @returns
13
  */
11
  */
14
-
15
-
16
- const Basic = (props) => {
17
-   return <div>Basic</div>
18
- }
19
- 
20
- const Poster = (props) => {
21
-  return <div>Poster</div>
22
-}
23
-
24
-const Share = (props) => {
25
-  return <div>Share</div>
26
-}
27
-
28
  const Edit = (props) => {
12
  const Edit = (props) => {
29
-   const [ tab, changeTab ] = useState('a');
30
-
13
+  const [ tab, changeTab ] = useState('basic');
14
+  const dynamicId = props.location.query.dynamicId
15
+  console.log(dynamicId)
16
+
17
+  const Basic = (props) => {
18
+  return <div>Basic</div>
19
+  }
20
+  
21
+  const Poster = (props) => {
22
+   return <div>Poster</div>
23
+  }
24
+ 
25
+  const Share = (props) => {
26
+    return <div>Share</div>
27
+  }
31
 
28
 
32
   return (
29
   return (
33
     <div>
30
     <div>
34
       <div>
31
       <div>
35
         <Radio.Group value={tab} buttonStyle="solid" onChange={e => changeTab(e.target.value)}>
32
         <Radio.Group value={tab} buttonStyle="solid" onChange={e => changeTab(e.target.value)}>
36
-          <Radio.Button value="a">基本信息</Radio.Button>
37
-          <Radio.Button value="b">海报图片</Radio.Button>
38
-          <Radio.Button value="c">分享设置</Radio.Button>
33
+          <Radio.Button value="basic">基本信息</Radio.Button>
34
+          <Radio.Button value="poster">海报图片</Radio.Button>
35
+          <Radio.Button value="share">分享设置</Radio.Button>
39
         </Radio.Group>
36
         </Radio.Group>
40
       </div>
37
       </div>
41
       <div>
38
       <div>
42
-        { tab === 'a' && <Basic /> }
43
-        { tab === 'b' && <Poster /> }
44
-        { tab === 'c' && <Share /> }
39
+        { tab === 'basic' && <Basic /> }
40
+        { tab === 'poster' && <Poster /> }
41
+        { tab === 'share' && <Share /> }
45
       </div>
42
       </div>
46
     </div>
43
     </div>
47
   );
44
   );