Commit d3f626c9 by 林家欣

首页新增后台轮播图预览

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