Commit d3f626c9 by 林家欣

首页新增后台轮播图预览

parent e81eb035
import {
POST, POSTFORM,
GET, POST, POSTFORM,
} from "../fetch.js"
const Prefix = process.env.NODE_ENV === 'development' ? '/gs1' : '';
// 后台轮播图预览
const indexCarouselManage = (params = {}) => {
return GET(`${Prefix}/office/indexCarouselManage/info/${params.id}`, {})
}
// 首页大轮播图
const homeBigImages = (params = {}) => {
return POST(`${Prefix}/office/indexCarouselManage/api/bigImages`, params)
......@@ -45,6 +50,7 @@ const updateCustomService = (params = {}) => {
export default {
indexCarouselManage,
homeBigImages,
homePictureImageList,
homeImportantNewList,
......
......@@ -69,7 +69,7 @@ export function handleResponseSuccess(res = {}) {
success: true,
returnCode: res.code || ResponseCode.success[0],
returnMsg: res.msg || "请求成功",
data: res.data || res.page || res.member || null
data: res.data || res.page || res.member || res.indexCarouselManage || null
}
}
......
......@@ -1088,6 +1088,33 @@ export default {
this.homeGetsdztListTopNews();
// 首页小轮播图
this.homeSmallImages();
// 后台轮播图预览
if (this.$route.query && this.$route.query.indexCarouselManageId) {
this.indexCarouselManage(this.$route.query.indexCarouselManageId);
}
},
// 后台轮播图预览
async indexCarouselManage(indexCarouselManageId) {
// console.log(this.$api, 'this.$api');
const query = {
id: indexCarouselManageId,
}
const indexCarouselManageRes = await this.$api.home.indexCarouselManage(query);
const { returnCode, data } = indexCarouselManageRes;
console.log(indexCarouselManageRes, "后台轮播图预览");
if (returnCode === "0") {
const list = [];
const childList = [];
if (data.classnum === '大轮播') {
list.push(data);
this.banner = list;
} else {
childList.push(data);
list.push(childList);
this.smallPCImages = list;
}
}
},
// 首页大轮播图
async homeBigImages() {
......
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