Commit 410eef8f by 林家欣

首页党建文化、小轮播图联调

parent c62ab753
...@@ -58,7 +58,7 @@ function fetch(options) { ...@@ -58,7 +58,7 @@ function fetch(options) {
} }
}) //响应数据的拦截 }) //响应数据的拦截
instance().then(res => { instance().then(res => {
console.log(res, '响应数据的拦截'); // console.log(res, '响应数据的拦截');
const resData = res.data || {} const resData = res.data || {}
const code = String(resData.code) const code = String(resData.code)
if (code === ResponseCode.success) { if (code === ResponseCode.success) {
......
...@@ -27,10 +27,16 @@ const homeGet4PartyTopNews = (params = {}) => { ...@@ -27,10 +27,16 @@ const homeGet4PartyTopNews = (params = {}) => {
} }
// 首页小轮播图
const homeSmallImages = (params = {}) => {
return POST(`${Prefix}/office/indexCarouselManage/api/smallImages`, params)
}
export default { export default {
homeBigImages, homeBigImages,
homePictureImageList, homePictureImageList,
homeImportantNewList, homeImportantNewList,
homeGet4PartyTopNews, homeGet4PartyTopNews,
homeSmallImages,
} }
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div v-for="(tmp, i) in list" :key="i" class="row" @click="handelMsg"> <div v-for="(tmp, i) in list" :key="i" class="row" @click="handelMsg">
<div class="col li"> <div class="col li">
<span></span> <span></span>
<span>{{tmp.name}}</span> <span>{{tmp.title}}</span>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -453,29 +453,14 @@ ...@@ -453,29 +453,14 @@
data-bs-interval="false" data-bs-interval="false"
> >
<div class="carousel-inner"> <div class="carousel-inner">
<div class="carousel-item active"> <div
<div class="row"> :class="['carousel-item', { active: i === 0 }]"
<div class="col-lg-4"> v-for="(tmpA, i) in smallImages"
<img src="../../assets/image/home/advert-tp1.png" /> :key="i"
</div> >
<div class="col-lg-4">
<img src="../../assets/image/home/advert-tp2.png" />
</div>
<div class="col-lg-4">
<img src="../../assets/image/home/advert-tp3.png" />
</div>
</div>
</div>
<div class="carousel-item">
<div class="row"> <div class="row">
<div class="col-lg-4"> <div class="col-lg-4" v-for="(tmpB, ii) in tmpA" :key="ii" @click="handelSmallImagesClick(tmpB)">
<img src="../../assets/image/home/advert-tp3.png" /> <img :src="tmpB.picIndexPath" />
</div>
<div class="col-lg-4">
<img src="../../assets/image/home/advert-tp2.png" />
</div>
<div class="col-lg-4">
<img src="../../assets/image/home/advert-tp1.png" />
</div> </div>
</div> </div>
</div> </div>
...@@ -791,40 +776,24 @@ export default { ...@@ -791,40 +776,24 @@ export default {
}, },
spqqsfz: {}, // 商品全球身份证 spqqsfz: {}, // 商品全球身份证
djwh: { djwh: {
data: [ data: [],
{
name: "办公室党支部组织第三季度党课和青年小组学习",
},
{
name: "党委办公室党支部、编码管理部党支部、成员服务部党支部联合开展主题党日活动",
},
{
name: "编码中心党委理论学习中心组举行2021年度第九次集体学习",
},
{
name: "办公室党支部召开党史学习教育专题组织生活会",
},
{
name: "编码中心党委理论学习中心组 举行2021年度第八次集体学习",
},
],
}, },
ztjj: { ztjj: {
data: [ data: [
{ {
name: "“扫”遍双十一 “码”上确定性", title: "“扫”遍双十一 “码”上确定性",
}, },
{ {
name: "“码上”陪你笑傲电商江湖", title: "“码上”陪你笑傲电商江湖",
}, },
{ {
name: "进口商品如何发布全网,拿好这个跨境进口数据法宝", title: "进口商品如何发布全网,拿好这个跨境进口数据法宝",
}, },
{ {
name: "小条码,大未来", title: "小条码,大未来",
}, },
{ {
name: "助力电商逆生长,“码”上加速有法宝", title: "助力电商逆生长,“码”上加速有法宝",
}, },
], ],
}, },
...@@ -908,6 +877,7 @@ export default { ...@@ -908,6 +877,7 @@ export default {
}, },
], ],
}, },
smallImages: [],
}; };
}, },
created() { created() {
...@@ -928,6 +898,8 @@ export default { ...@@ -928,6 +898,8 @@ export default {
this.homeNewGtin(); this.homeNewGtin();
// 党建文化新闻列表 // 党建文化新闻列表
this.homeGet4PartyTopNews(); this.homeGet4PartyTopNews();
// 首页小轮播图
this.homeSmallImages();
}, },
// 首页大轮播图 // 首页大轮播图
async homeBigImages() { async homeBigImages() {
...@@ -990,15 +962,40 @@ export default { ...@@ -990,15 +962,40 @@ export default {
async homeGet4PartyTopNews() { async homeGet4PartyTopNews() {
const params = { const params = {
count: 5, count: 5,
classid: '', classid: 428,
} };
const homeGet4PartyTopNewsRes = const homeGet4PartyTopNewsRes = await this.$api.home.homeGet4PartyTopNews(
await this.$api.home.homeGet4PartyTopNews(params); params
);
const { returnCode, data } = homeGet4PartyTopNewsRes; const { returnCode, data } = homeGet4PartyTopNewsRes;
if (returnCode === "0") { if (returnCode === "0") {
console.log(homeGet4PartyTopNewsRes, "党建文化新闻列表"); console.log(homeGet4PartyTopNewsRes, "党建文化新闻列表");
this.djwh.data = data;
} }
}, },
// 首页小轮播图
async homeSmallImages() {
const homeSmallImagesRes = await this.$api.home.homeSmallImages();
const { returnCode, data } = homeSmallImagesRes;
if (returnCode === "0") {
let list = [];
data.forEach((el, i) => {
el.picIndexPath = `http://www.gs1cn.org/img/demo/${el.picIndexPath}`;
list.push(el);
if ((i + 1) % 3 === 0) {
this.smallImages.push(list);
list = [];
} else if (i === data.length - 1) {
this.smallImages.push(list);
}
});
console.log(homeSmallImagesRes, "首页小轮播图");
}
},
// 首页小轮播图点击跳转
handelSmallImagesClick(obj) {
window.open(obj.directpath, "_blank");
},
// 我要申请商品条码 // 我要申请商品条码
wysqsptmHandelClick() { wysqsptmHandelClick() {
this.$router.push({ this.$router.push({
...@@ -1600,6 +1597,7 @@ export default { ...@@ -1600,6 +1597,7 @@ export default {
.carousel-item { .carousel-item {
img { img {
width: 100%; width: 100%;
cursor: pointer;
} }
} }
.carousel-control-prev, .carousel-control-prev,
......
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