Commit 29f0b5e8 authored by jiaorz's avatar jiaorz

新增活动置顶

parent 9597a786
......@@ -48,6 +48,16 @@ export function isPublishStatus(id, state) {
method: 'put'
});
}
/**
* 是否置顶、不发布
* */
export function isHomePageStatus(id, state) {
return fetch({
url: '/api/uccn/admin/summitActivity/home_page/' + id + '/' + state,
method: 'put'
});
}
/**
*删除活动
*/
......
......@@ -97,7 +97,10 @@
</el-button>
<el-button size="small" class="el-button el-button--text el-button--small" v-if="scope.row.isPublish==1 && campsiteshop_btn_update_salestatus" @click="isPublishStatus(scope.row)">不发布
</el-button>
<el-button size="small" class="el-button el-button--text el-button--small" v-if="(scope.row.isHomePage==0) && campsiteshop_btn_update_salestatus" @click="isHomePageStatus(scope.row)">发布
</el-button>
<el-button size="small" class="el-button el-button--text el-button--small" v-if="scope.row.isHomePage==1 && campsiteshop_btn_update_salestatus" @click="isHomePageStatus(scope.row)">不发布
</el-button>
<el-button class="el-button el-button--text el-button--small" style="color:red;" size="small" @click="deleteHandler(scope.row)" v-if="campsiteshop_btn_del">删除</el-button>
</template>
</el-table-column>
......@@ -139,6 +142,7 @@ import {
getActivityList,
isShowStatus,
isPublishStatus,
isHomePageStatus,
deleteActivityTag
} from '../../api/officialWebsit/activity';
import Element1 from "../admin/menu/components/element";
......@@ -296,6 +300,34 @@ import {
}
});
},
/**
* 是否置顶 参数 id status 1-上架;2-下架 post
*/
isHomePageStatus(row){
let params = {
id: row.id,
state: row.isHomePage== 1 ? 0 : 1
};
isHomePageStatus(params.id, params.state).then(response => {
if (response.status === 200) {
this.$notify({
title: '成功',
message: '成功',
type: 'success',
duration: 2000
});
this.oneCampsiteDialogVisible = false;
this.getList();
} else {
this.$notify({
title: '失败',
message: rsCode.msg[response.code] ? rsCode.msg[response.code] : '操作失败!',
type: 'error',
duration: 2000
});
}
});
},
/**
* 编辑
* */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment