数据穿透优化
This commit is contained in:
parent
ad17736e30
commit
b8f7311e67
@ -40,35 +40,41 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 实践项目 -->
|
<!-- 实践项目 -->
|
||||||
<div v-if="item.id == '1813831932748894208'" class="list">
|
<div v-else-if="item.id == '1813831932748894208'" class="swiper-list">
|
||||||
<div class="item" v-for="(item, index) in teachingAchievements2" :key="index">
|
<div class="item" v-for="(item, index) in teachingAchievements2" :key="index">
|
||||||
<div class="img">
|
<div class="img">
|
||||||
<img :src="imgurl + item.contentImg" alt="">
|
<img :src="imgurl + item.contentImg" alt="" class="imgWO">
|
||||||
</div>
|
</div>
|
||||||
<div class="tt">{{ item.contentTitle }}</div>
|
<div class="tt">{{ item.contentTitle }}</div>
|
||||||
<div class="desc">
|
<div class="desc">
|
||||||
<div class="desc" v-html="item.summary"></div>
|
{{ item.summary }}
|
||||||
</div>
|
</div>
|
||||||
|
<div class="time">{{ item.publishDate }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 实践项目 -->
|
<!-- 自制仪器设备 -->
|
||||||
<div v-if="item.id == '1813832045458231296'" class="list">
|
<div v-else-if="item.id == '1813832045458231296'" class="swiper-list">
|
||||||
<div class="item" v-for="(item, index) in teachingAchievements3" :key="index">
|
<div class="item" v-for="(item, index) in teachingAchievements3" :key="index">
|
||||||
<div class="img">
|
<div class="img">
|
||||||
<img :src="imgurl + item.contentImg" alt="">
|
<img :src="imgurl + item.contentImg" alt="">
|
||||||
</div>
|
</div>
|
||||||
<div class="tt">{{ item.contentTitle }}</div>
|
<div class="tt">{{ item.contentTitle }}</div>
|
||||||
<div class="desc">
|
<!-- <div class="desc">
|
||||||
<div class="desc" v-html="item.summary"></div>
|
{{ item.summary }}
|
||||||
</div>
|
</div> -->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 通用 -->
|
<!-- 通用 -->
|
||||||
<div class="neirong" v-html="pageContextList[index]" v-else></div>
|
<div class="neirong" v-html="pageContextList[index]" v-else></div>
|
||||||
|
|
||||||
|
<!-- 详情数据穿透 -->
|
||||||
|
<div class="team" v-if="currentActive == 999 && isShowDetails">
|
||||||
|
<div class="neirong" v-html="detailsContent"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -100,6 +106,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div> -->
|
</div> -->
|
||||||
|
|
||||||
<!-- 实践项目 -->
|
<!-- 实践项目 -->
|
||||||
<!-- <div class="xjxm" v-if="currentActive == 2">
|
<!-- <div class="xjxm" v-if="currentActive == 2">
|
||||||
<div class="list">
|
<div class="list">
|
||||||
@ -115,6 +122,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="page">
|
<div class="page">
|
||||||
<el-pagination background layout="prev, pager, next" :total="1000" class="">
|
<el-pagination background layout="prev, pager, next" :total="1000" class="">
|
||||||
</el-pagination>
|
</el-pagination>
|
||||||
@ -158,6 +166,8 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
isShowDetails:false,
|
||||||
|
detailsContent:"",
|
||||||
imgurl: process.env.VUE_APP_BASE_API,
|
imgurl: process.env.VUE_APP_BASE_API,
|
||||||
teachingAchievements: [],
|
teachingAchievements: [],
|
||||||
teachingAchievements2: [],
|
teachingAchievements2: [],
|
||||||
@ -196,12 +206,18 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
showDetails(value){
|
||||||
|
this.isShowDetails = true;
|
||||||
|
this.currentActive = 999;
|
||||||
|
this.detailsContent = value.contentDetail;
|
||||||
|
},
|
||||||
// 触发导航
|
// 触发导航
|
||||||
getCurrentActive(value) {
|
getCurrentActive(value) {
|
||||||
if (this.currentActive == value) {
|
if (this.currentActive == value) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.currentActive = value
|
this.currentActive = value;
|
||||||
|
this.isShowDetails = false;
|
||||||
},
|
},
|
||||||
initPageData() {
|
initPageData() {
|
||||||
|
|
||||||
@ -220,17 +236,19 @@ export default {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.pageContextList.push(context);
|
this.pageContextList.push(context);
|
||||||
|
//实践平台
|
||||||
if (cloumnItem.id == "1813831828977618944") {
|
if (cloumnItem.id == "1813831828977618944") {
|
||||||
cloumnItem.children.list.forEach(element => {
|
cloumnItem.children.list.forEach(element => {
|
||||||
this.teachingAchievements.push(element);
|
this.teachingAchievements.push(element);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
//实践项目
|
||||||
if (cloumnItem.id == "1813831932748894208") {
|
if (cloumnItem.id == "1813831932748894208") {
|
||||||
cloumnItem.children.list.forEach(element => {
|
cloumnItem.children.list.forEach(element => {
|
||||||
this.teachingAchievements2.push(element);
|
this.teachingAchievements2.push(element);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
//自制仪器设备
|
||||||
if (cloumnItem.id == "1813832045458231296") {
|
if (cloumnItem.id == "1813832045458231296") {
|
||||||
cloumnItem.children.list.forEach(element => {
|
cloumnItem.children.list.forEach(element => {
|
||||||
this.teachingAchievements3.push(element);
|
this.teachingAchievements3.push(element);
|
||||||
@ -611,7 +629,7 @@ export default {
|
|||||||
|
|
||||||
.list .item .img {
|
.list .item .img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 287px;
|
height: 19rem;
|
||||||
border-radius: 0px 0px 0px 0px;
|
border-radius: 0px 0px 0px 0px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
@ -945,4 +963,71 @@ export default {
|
|||||||
margin-bottom: -85px;
|
margin-bottom: -85px;
|
||||||
/* padding-bottom: 20px; */
|
/* padding-bottom: 20px; */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.swiper-list {
|
||||||
|
width: 80%;
|
||||||
|
margin: 30px auto;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-top: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.swiper-list .item {
|
||||||
|
width: 31%;
|
||||||
|
height: 432px;
|
||||||
|
margin-bottom: 30px;
|
||||||
|
position: relative;
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
.swiper-list .item .img {
|
||||||
|
width: 100%;
|
||||||
|
height: 287px;
|
||||||
|
border-radius: 0px 0px 0px 0px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.swiper-list .item .img img {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.swiper-list .item .tt {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 20px;
|
||||||
|
color: #005375;
|
||||||
|
margin: 15px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.swiper-list .item .desc {
|
||||||
|
overflow: hidden;
|
||||||
|
/** 隐藏超出的内容 **/
|
||||||
|
word-break: break-all;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
/** 多行 **/
|
||||||
|
display: -webkit-box;
|
||||||
|
/** 对象作为伸缩盒子模型显示 **/
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
/** 设置或检索伸缩盒对象的子元素的排列方式 **/
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
/** 显示的行数 **/
|
||||||
|
font-size: 18px;
|
||||||
|
color: #999999;
|
||||||
|
line-height: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.swiper-list .item .time {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 18px;
|
||||||
|
color: #005375;
|
||||||
|
}
|
||||||
|
|
||||||
|
.equip-img {
|
||||||
|
width: 100%;
|
||||||
|
height: 19rem;
|
||||||
|
border-radius: 0px 0px 0px 0px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -62,7 +62,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- main -->
|
<!-- main -->
|
||||||
|
<!-- 详情数据穿透 -->
|
||||||
<div class="team" v-if="currentActive == 999 && isShowDetails">
|
<div class="team" v-if="currentActive == 999 && isShowDetails">
|
||||||
<div class="neirong" v-html="detailsContent"></div>
|
<div class="neirong" v-html="detailsContent"></div>
|
||||||
</div>
|
</div>
|
||||||
@ -96,7 +96,7 @@ export default {
|
|||||||
imgurl: process.env.VUE_APP_BASE_API,
|
imgurl: process.env.VUE_APP_BASE_API,
|
||||||
pageContextList: [],
|
pageContextList: [],
|
||||||
teachingAchievements: [],
|
teachingAchievements: [],
|
||||||
detailsContent:[],
|
detailsContent:"",
|
||||||
teachingTeam: [],
|
teachingTeam: [],
|
||||||
nav: [
|
nav: [
|
||||||
// { name: '教学团队' },
|
// { name: '教学团队' },
|
||||||
|
@ -13,25 +13,71 @@
|
|||||||
<div class="left"> <img src="../../assets/gw/home.png" alt="">
|
<div class="left"> <img src="../../assets/gw/home.png" alt="">
|
||||||
<p><a href="/gw">首页</a><i class="el-icon-arrow-right"></i> <span href="">虚拟专业频道</span></p>
|
<p><a href="/gw">首页</a><i class="el-icon-arrow-right"></i> <span href="">虚拟专业频道</span></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="nav-item" v-for="(item, index) in nav" v-bind:class="[index === currentActive ? 'active' : '']"
|
<!-- <div class="nav-item" v-for="(item, index) in nav" v-bind:class="[index === currentActive ? 'active' : '']"
|
||||||
@click="getCurrentActive(index)">
|
@click="getCurrentActive(index)">
|
||||||
{{ item.categoryName }}
|
{{ item.categoryName }}
|
||||||
</div>
|
</div> -->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="top-swiper">
|
<!-- <div class="top-swiper">
|
||||||
<!-- main -->
|
main
|
||||||
<div v-for="(item, index) in nav " :key=index>
|
<div v-for="(item, index) in nav " :key=index>
|
||||||
<div class="teaching-list" v-if="currentActive == index">
|
<div class="teaching-list" v-if="currentActive == index">
|
||||||
<div class="neirong" v-html="pageContextList[index]"></div>
|
<div class="neirong" v-html="pageContextList[index]"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div> -->
|
||||||
|
|
||||||
|
<!-- <div class="list"> -->
|
||||||
|
<div v-if="!isShowDetails">
|
||||||
|
<!-- 顶部块 -->
|
||||||
|
<div class="top-swiper">
|
||||||
|
|
||||||
|
<swiper ref="mySwiper" :options="swiperOptions" style="width: 100%">
|
||||||
|
<swiper-slide class="banner-box" v-for="(item, index) in teachingAchievements" :key="index" >
|
||||||
|
<div class="left">
|
||||||
|
<img :src="imgurl + item.contentImg" alt="" class="imgWO">
|
||||||
|
<!-- <img src="../../assets/gw/Snipaste_2024-07-23_22-51-23.jpg" alt="" > -->
|
||||||
|
</div>
|
||||||
|
<div class="right">
|
||||||
|
<div class="time">{{ item.publishDate }}</div>
|
||||||
|
<div class="tt">{{ item.contentTitle }}</div>
|
||||||
|
<div class="desc">
|
||||||
|
{{ item.summary }}
|
||||||
|
</div>
|
||||||
|
<div class="more" @click="showDetails(item)">
|
||||||
|
<i class="el-icon-right"></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</swiper-slide>
|
||||||
|
</swiper>
|
||||||
|
<div class="swiper-pagination"></div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!-- 下部块 -->
|
||||||
|
<div class="list">
|
||||||
|
<div class="item" v-for="(item, index) in teachingAchievements " :key="index">
|
||||||
|
<div class="img">
|
||||||
|
<img :src="imgurl + item.contentImg" alt="" class="imgWO">
|
||||||
|
</div>
|
||||||
|
<div class="tt">{{ item.contentTitle }}</div>
|
||||||
|
<div class="desc">
|
||||||
|
{{ item.summary }}
|
||||||
|
</div>
|
||||||
|
<div class="time">{{ item.publishDate }}</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- </div> -->
|
||||||
<div class="page-box">
|
<div class="page-box">
|
||||||
<el-pagination background layout="prev, pager, next" :total="1000" class="">
|
<el-pagination background layout="prev, pager, next" :total="1000" class="" />
|
||||||
</el-pagination>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 详情数据穿透 -->
|
||||||
|
<div class="team" v-if="isShowDetails">
|
||||||
|
<div class="neirong" v-html="detailsContent"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<footers></footers>
|
<footers></footers>
|
||||||
@ -57,6 +103,11 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
isShowDetails:false,
|
||||||
|
detailsContent:"",
|
||||||
|
imgurl: process.env.VUE_APP_BASE_API,
|
||||||
|
topSwiperData: {},
|
||||||
|
teachingAchievements: [],
|
||||||
pageContextList: [],
|
pageContextList: [],
|
||||||
swiperOptions: {
|
swiperOptions: {
|
||||||
navigation: {
|
navigation: {
|
||||||
@ -93,7 +144,7 @@ export default {
|
|||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
created() {
|
||||||
// 页面加载完毕调用
|
// 页面加载完毕调用
|
||||||
this.initPageData();
|
this.initPageData();
|
||||||
},
|
},
|
||||||
@ -102,6 +153,11 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
showDetails(value){
|
||||||
|
debugger;
|
||||||
|
this.isShowDetails = true;
|
||||||
|
this.detailsContent = value.contentDetail;
|
||||||
|
},
|
||||||
// 触发导航
|
// 触发导航
|
||||||
getCurrentActive(value) {
|
getCurrentActive(value) {
|
||||||
if (this.currentActive == value) {
|
if (this.currentActive == value) {
|
||||||
@ -126,6 +182,18 @@ export default {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.pageContextList.push(context);
|
this.pageContextList.push(context);
|
||||||
|
// 虚拟专业频道
|
||||||
|
if (cloumnItem.id == "1818243334464999424") {
|
||||||
|
if (cloumnItem.children) {
|
||||||
|
//取首条数据作为顶部块展示
|
||||||
|
// this.topSwiperData = cloumnItem.children.list[0];
|
||||||
|
//除首条以外,用作下部块展示
|
||||||
|
for (let i = 0; i < cloumnItem.children.list.length; i++) {
|
||||||
|
|
||||||
|
this.teachingAchievements.push(cloumnItem.children.list[i]);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// cloumnItem.categoryName
|
// cloumnItem.categoryName
|
||||||
});
|
});
|
||||||
@ -149,10 +217,12 @@ export default {
|
|||||||
width: 240px;
|
width: 240px;
|
||||||
border-radius: 50px;
|
border-radius: 50px;
|
||||||
}
|
}
|
||||||
.page-box{
|
|
||||||
|
.page-box {
|
||||||
width: 82%;
|
width: 82%;
|
||||||
margin: 10px auto;
|
margin: 10px auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 圆形分页按钮样式 */
|
/* 圆形分页按钮样式 */
|
||||||
::v-deep .el-pagination .el-pager li:not(.disabled) {
|
::v-deep .el-pagination .el-pager li:not(.disabled) {
|
||||||
border-radius: 100%;
|
border-radius: 100%;
|
||||||
@ -622,4 +692,6 @@ export default {
|
|||||||
line-height: 18px;
|
line-height: 18px;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
Loading…
Reference in New Issue
Block a user