Commit d38d16b6 by 林家欣

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

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