Просмотр исходного кода

Merge branch 'dev' of http://git.ycjcjy.com/zhiyuxing/estateagents-admin-manager into dev

傅行帆 5 лет назад
Родитель
Сommit
162325e49b
2 измененных файлов: 21 добавлений и 0 удалений
  1. 16
    0
      src/pages/activity/ActivityList.jsx
  2. 5
    0
      src/services/apis.js

+ 16
- 0
src/pages/activity/ActivityList.jsx Просмотреть файл

@@ -159,6 +159,9 @@ const header = props => {
159 159
           <AuthButton name="admin.buildingDynamic.tag" noRight={null}>
160 160
             <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row)}>{row.weight === 1 ? '取消标签' : '添加标签'}<Icon type="vertical-align-top" className={styles.edit} /></span>
161 161
           </AuthButton>
162
+          <AuthButton name="admin.buildingDynamic.tag" noRight={null}>
163
+            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={homeDynamic(row)}>{row.home === 1 ? '取消推首页' : '推首页'}<Icon type="vertical-align-top" className={styles.edit} /></span>
164
+          </AuthButton>
162 165
           <AuthButton name="admin.buildingDynamic.update.put" noRight={null}>
163 166
             {(row.activityStatus === 0 || row.activityStatus === 1) && <span style={{ color: '#FF925C',marginRight: '20px', cursor: 'pointer' }} onClick={toEditGoods(row.dynamicId)}>编辑<Icon type="form" className={styles.edit} /></span>}
164 167
           </AuthButton>
@@ -207,6 +210,19 @@ const header = props => {
207 210
     })
208 211
   }
209 212
 
213
+  //   推首页
214
+  const homeDynamic = row => () => {
215
+    const home = Math.abs(row.home - 1)
216
+    request({ ...apis.activity.home, params: { dynamicId: row.dynamicId, home } }).then(data => {
217
+      console.log(data)
218
+      message.info('操作成功!')
219
+      getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() })
220
+    }).catch(err => {
221
+      console.log(err)
222
+      message.info(err.msg || err.message)
223
+    })
224
+  }
225
+
210 226
   const sendOrPublicDynamic = row => {
211 227
     if (row.status === 1) {
212 228
       cancelDynamic(row)

+ 5
- 0
src/services/apis.js Просмотреть файл

@@ -403,6 +403,11 @@ export default {
403 403
         url: `${prefix}/buildingDynamic/weight`,
404 404
         action: 'admin.buildingDynamic.weight.put',
405 405
       },
406
+      home: {
407
+        method: 'PUT',
408
+        url: `${prefix}/buildingDynamic/home`,
409
+        action: 'admin.buildingDynamic.home.put',
410
+      },
406 411
       cancel: {
407 412
         method: 'PUT',
408 413
         url: `${prefix}/buildingDynamic/cancel/:id`,