zlisen 3 years ago
parent
commit
10f9538831
2 changed files with 40 additions and 4 deletions
  1. 21
    4
      src/pages/Live/LiveActivity/List/index.jsx
  2. 19
    0
      src/pages/Live/video/List/index.jsx

+ 21
- 4
src/pages/Live/LiveActivity/List/index.jsx View File

@@ -90,10 +90,19 @@ const header = props => {
90 90
       .catch(err => {
91 91
         // message.info(err.msg)
92 92
       });
93
-  };onDelete
94
-
95
-  const onDelete = rowData  => {
93
+  };
94
+  const onLiveHome = row => {
95
+    request({ ...apis.taliveActivity.livehome, urlData: { id: row.liveActivityId } })
96
+      .then(data => {
97
+        message.info('操作成功');
98
+        getList({ pageNum: data.current, pageSize: 10 });
99
+      })
100
+      .catch(err => {
101
+        // message.info(err.msg)
102
+      });
103
+  };
96 104
 
105
+  const onDelete = rowData => {
97 106
     Modal.confirm({
98 107
       title: '确认删除?',
99 108
       okText: '确定',
@@ -252,12 +261,20 @@ const header = props => {
252 261
           />
253 262
         </AuthButton>,
254 263
 
264
+        <AuthButton name="live.home" noRight={null}>
265
+          <EditIcon
266
+            type={record.isHome === 1 ? 'cancel' : 'top'}
267
+            text={record.isHome === 1 ? '取消推首页' : '推荐首页'}
268
+            onClick={()=>onLiveHome(record)}
269
+          />
270
+        </AuthButton>,
271
+
255 272
         <AuthButton name="live.edit" noRight={null}>
256 273
           <EditIcon type="look" text="查看详情" onClick={toAddLive(record)} />
257 274
         </AuthButton>,
258 275
 
259 276
         <AuthButton name="live.delete" noRight={null}>
260
-          <EditIcon type="delete" text="删除" onClick={()=>onDelete(record)} />
277
+          <EditIcon type="delete" text="删除" onClick={() => onDelete(record)} />
261 278
         </AuthButton>,
262 279
       ]),
263 280
     },

+ 19
- 0
src/pages/Live/video/List/index.jsx View File

@@ -50,6 +50,19 @@ const Video = props => {
50 50
       });
51 51
   };
52 52
 
53
+  const onVideoHome = row => {
54
+    request({ ...apis.video.home, urlData: { id: row.videoId } })
55
+      .then(() => {
56
+        message.success('操作成功');
57
+        // setLoading(false);
58
+        ref.current.reload();
59
+      })
60
+      .catch(err => {
61
+        console.error(err);
62
+        message.error('操作失败');
63
+      });
64
+  };
65
+
53 66
   const onDelete = row => {
54 67
     request({ ...apis.video.delete, urlData: { id: row.videoId } })
55 68
       .then(() => {
@@ -142,6 +155,12 @@ const Video = props => {
142 155
           /> */}
143 156
         </AuthButton>,
144 157
 
158
+        <AuthButton name="video.home" noRight={null}>
159
+          <OperButton onClick={() => onVideoHome(row)}>
160
+            {row.isHome ? '取消推首页' : '推荐首页'}
161
+          </OperButton>
162
+        </AuthButton>,
163
+
145 164
         <AuthButton name="video.delete" noRight={null}>
146 165
           <OperButton.Confirm
147 166
             title="确认删除?"