Procházet zdrojové kódy

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

傅行帆 před 5 roky
rodič
revize
162325e49b
2 změnil soubory, kde provedl 21 přidání a 0 odebrání
  1. 16
    0
      src/pages/activity/ActivityList.jsx
  2. 5
    0
      src/services/apis.js

+ 16
- 0
src/pages/activity/ActivityList.jsx Zobrazit soubor

159
           <AuthButton name="admin.buildingDynamic.tag" noRight={null}>
159
           <AuthButton name="admin.buildingDynamic.tag" noRight={null}>
160
             <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row)}>{row.weight === 1 ? '取消标签' : '添加标签'}<Icon type="vertical-align-top" className={styles.edit} /></span>
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
           </AuthButton>
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
           <AuthButton name="admin.buildingDynamic.update.put" noRight={null}>
165
           <AuthButton name="admin.buildingDynamic.update.put" noRight={null}>
163
             {(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>}
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
           </AuthButton>
167
           </AuthButton>
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
   const sendOrPublicDynamic = row => {
226
   const sendOrPublicDynamic = row => {
211
     if (row.status === 1) {
227
     if (row.status === 1) {
212
       cancelDynamic(row)
228
       cancelDynamic(row)

+ 5
- 0
src/services/apis.js Zobrazit soubor

403
         url: `${prefix}/buildingDynamic/weight`,
403
         url: `${prefix}/buildingDynamic/weight`,
404
         action: 'admin.buildingDynamic.weight.put',
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
       cancel: {
411
       cancel: {
407
         method: 'PUT',
412
         method: 'PUT',
408
         url: `${prefix}/buildingDynamic/cancel/:id`,
413
         url: `${prefix}/buildingDynamic/cancel/:id`,