diff --git a/src/api/swiper-manage/index.js b/src/api/swiper-manage/index.js index bdba763c..c12d6586 100644 --- a/src/api/swiper-manage/index.js +++ b/src/api/swiper-manage/index.js @@ -17,16 +17,18 @@ export const getSwiperListApi = (data) => { }); }; // 修改轮播图状态 -export const editHomeSwiperTypeApi = () => { +export const editHomeSwiperTypeApi = (data) => { return request({ - url: "/auth/getConfig", - method: "get", + url: "/material-mall/bm_slide_show/edit", + method: "post", + data, }); }; // 删除轮播图 -export const deleteHomeSwiperApi = () => { +export const deleteHomeSwiperApi = (id) => { return request({ - url: "/auth/getConfig", - method: "get", + url: `/material-mall/bm_slide_show/del/${id}`, + method: "post", + data, }); }; diff --git a/src/views/swiper-manage/index.vue b/src/views/swiper-manage/index.vue index 658b4583..d86a0f39 100644 --- a/src/views/swiper-manage/index.vue +++ b/src/views/swiper-manage/index.vue @@ -262,19 +262,18 @@ export default { }) .catch(() => {}); }, - onSwitchChange(val, row) { - if (!val) { - this.$confirm("确定禁用该轮播图吗?", "提示", { - confirmButtonText: "确定", - cancelButtonText: "取消", - type: "warning", - }) - .then(() => {}) - .catch(() => { - row.isShow = true; - }); + async onSwitchChange(val, row) { + console.log(row, "列表消息"); + const { id } = row; + const params = { + id, + delFlag: val ? 0 : 2, + }; + const res = await editHomeSwiperTypeApi(params); + if (res.code === 200) { + this.$modal.msgSuccess("状态修改成功"); + this.getSwiperListData(); } - console.log(row, "row---"); }, }, };