傅行帆 преди 5 години
родител
ревизия
bfa16f7276
променени са 2 файла, в които са добавени 27 реда и са изтрити 29 реда
  1. 6
    5
      src/pages/activity/ActivityList.jsx
  2. 21
    24
      src/pages/activity/editActivity.jsx

+ 6
- 5
src/pages/activity/ActivityList.jsx Целия файл

@@ -34,7 +34,7 @@ const header = (props) => {
34 34
 
35 35
   
36 36
 // 跳转到编辑商品
37
-const toEditGoods = (dynamicId) => {
37
+const toEditGoods = (dynamicId) => () => {
38 38
     router.push({
39 39
       pathname: '/activity/editActivity',
40 40
       query: {
@@ -103,8 +103,8 @@ const toEditGoods = (dynamicId) => {
103 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 104
                            <span style={{ color: '#1990FF' }} onClick={sendOrPublicDynamic.bind(this,row)}>{ row.status === 1 ? '取消发布' : '发布' }<Icon type="close-circle" className={styles.edit} /></span>
105 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,7 +140,8 @@ const toEditGoods = (dynamicId) => {
140 140
         });
141 141
   }
142 142
   
143
-  const topDynamic = (row) => {
143
+//   置顶
144
+  const topDynamic = (row) => () => {
144 145
       const weight = Math.abs(row.weight - 1)
145 146
       request({
146 147
           url: '/api/admin/buildingDynamic/weight',
@@ -249,7 +250,7 @@ const handleSubmit = (e, props) => {
249 250
           </Button>
250 251
         </Form.Item>
251 252
       </Form>
252
-      <Button type="primary" className={styles.addBtn} onClick={toEditGoods}>新增</Button>
253
+      <Button type="primary" className={styles.addBtn} onClick={toEditGoods()}>新增</Button>
253 254
       <Table dataSource={data.list} columns={columns} pagination={false}/>
254 255
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
255 256
         <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} />

+ 21
- 24
src/pages/activity/editActivity.jsx Целия файл

@@ -3,45 +3,42 @@ import { Form, Input, Button, Icon, Select, Tabs, Radio } from 'antd';
3 3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4 4
 import styles from '../style/GoodsList.less';
5 5
 
6
-
7
-
8 6
 /**
9 7
  *
10 8
  *
11 9
  * @param {*} props
12 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 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 29
   return (
33 30
     <div>
34 31
       <div>
35 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 36
         </Radio.Group>
40 37
       </div>
41 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 42
       </div>
46 43
     </div>
47 44
   );