Commit d38d16b6 by 林家欣

fix: 修改首页图片资讯后台预览

parent afd79760
......@@ -9,6 +9,9 @@ const Prefix = process.env.NODE_ENV === 'development' ? '/gs1' : '';
const indexCarouselManage = (params = {}) => {
return GET(`${Prefix}/office/indexCarouselManage/api/info/${params.id}`, {})
}
const homePicture = (params = {}) => {
return GET(`${Prefix}/office/picture/api/info/${params.id}`, {})
}
// 首页大轮播图
const homeBigImages = (params = {}) => {
......@@ -51,6 +54,7 @@ const updateCustomService = (params = {}) => {
export default {
indexCarouselManage,
homePicture,
homeBigImages,
homePictureImageList,
homeImportantNewList,
......
......@@ -107,9 +107,7 @@
</li>
</ul>
<div class="tab-content marginTop15">
<div
class="tab-pane fade show active"
>
<div class="tab-pane fade show active">
<list :list="news[0].data" />
</div>
</div>
......@@ -893,7 +891,7 @@ export default {
{
name: "国家射频识别产品质量检验检测中心",
url: "http://www.spjc.org.cn/",
type: 'link',
type: "link",
},
{
name: "国家条码质量检验检测中心",
......@@ -905,24 +903,24 @@ export default {
{
name: "中国自动识别技术协会",
url: "http://www.aimchina.org.cn/",
type: 'link',
type: "link",
},
{
name: "中国条码技术与应用协会",
url: "http://www.cabc.net.cn/",
type: 'link',
type: "link",
},
{
name: "《中国自动识别技术》杂志社",
subName: "电子版",
url: "http://www.aidchina.com.cn/",
subUrl: "http://www.aidchina.com.cn/zzzq/index.htm",
type: 'link',
type: "link",
},
{
name: "中国ECR委员会",
url: "http://www.ecrchina.org/",
type: 'link',
type: "link",
},
{
name: "全国物品编码标准化技术委员会",
......@@ -966,7 +964,7 @@ export default {
{
name: "北京东方捷码科技开发中心",
url: "http://www.anccweb.com/",
type: 'link',
type: "link",
},
],
},
......@@ -1032,7 +1030,7 @@ export default {
async getCustomServiceFromServer() {
// 判断是否登录
if(localStorage.getItem('loginInfo')){
if (localStorage.getItem("loginInfo")) {
const searchGlnRes = await this.$api.home.customService();
const { returnCode, data } = searchGlnRes;
if (returnCode === "0") {
......@@ -1071,26 +1069,34 @@ export default {
},
// 初始化
init() {
// 首页大轮播图
this.homeBigImages();
// 要闻左侧图片资讯
this.homePictureImageList();
// 要闻右侧标题列表
this.homeImportantNewList();
// 商品全球身份证
this.homeNewGtin();
// 党建文化新闻列表
Promise.all([this.homeGet4PartyTopNews(), this.homeGet1PartyTopNews()]).then((result => {
console.log(result, '党建文化新闻列表集合');
Promise.all([
this.homeGet4PartyTopNews(),
this.homeGet1PartyTopNews(),
]).then((result) => {
console.log(result, "党建文化新闻列表集合");
this.djwh.data = [].concat(result[0], result[1]);
}));
});
// 专题聚焦
this.homeGetsdztListTopNews();
// 首页小轮播图
this.homeSmallImages();
// 后台轮播图预览
if (this.$route.query && this.$route.query.indexCarouselManageId) {
this.indexCarouselManage(this.$route.query.indexCarouselManageId);
} else {
// 首页大轮播图
this.homeBigImages();
// 首页小轮播图
this.homeSmallImages();
}
if (this.$route.query && this.$route.query.pictureId) {
this.homePicture(this.$route.query.pictureId);
} else {
// 要闻左侧图片资讯
this.homePictureImageList();
}
},
// 后台轮播图预览
......@@ -1098,23 +1104,46 @@ export default {
// console.log(this.$api, 'this.$api');
const query = {
id: indexCarouselManageId,
}
const indexCarouselManageRes = await this.$api.home.indexCarouselManage(query);
};
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 === '大轮播') {
if (data.classnum === "大轮播") {
list.push(data);
this.banner = list;
// 首页小轮播图
this.homeSmallImages();
} else {
childList.push(data);
list.push(childList);
this.smallPCImages = list;
// 首页大轮播图
this.homeBigImages();
}
}
},
async homePicture(pictureId) {
// console.log(this.$api, 'this.$api');
const query = {
id: pictureId,
};
const indexCarouselManageRes = await this.$api.home.indexCarouselManage(
query
);
const { returnCode, data } = indexCarouselManageRes;
console.log(indexCarouselManageRes, "后台轮播图预览2");
if (returnCode === "0") {
const list = [];
data.jumppath = data.directpath;
data.picFile = data.picIndexPath;
list.push(data);
this.newsBanner = list;
}
},
// 首页大轮播图
async homeBigImages() {
......@@ -1829,7 +1858,7 @@ export default {
padding: 18px 0;
}
.marginTop15{
.marginTop15 {
margin-top: 15px;
}
......@@ -2104,7 +2133,7 @@ export default {
align-items: center;
justify-content: center;
width: 100%;
.ywdt-bt{
.ywdt-bt {
width: 100%;
text-align: center;
}
......
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