提交 13d4254c authored 作者: pengxiaohui's avatar pengxiaohui

项目介绍模块增加学校简介选项卡

上级 245767fa
......@@ -4,6 +4,7 @@
<ul class="tap-btn">
<li :class="showIndex === 1 ? 'active' : ''" @click="tap(1)">本科1+2项目</li>
<li :class="showIndex === 2 ? 'active' : ''" @click="tap(2)">硕士直通车项目</li>
<li :class="showIndex === 3 ? 'active' : ''" @click="tap(3)">学校简介</li>
</ul>
</div>
<div class="tap-item-box">
......@@ -13,6 +14,9 @@
<div class="t-item2 con970" v-show="showIndex === 2">
<news :data="newsData2"></news>
</div>
<div class="t-item2 con970" v-show="showIndex === 3">
<news :data="newsData3"></news>
</div>
</div>
</div>
</template>
......@@ -28,12 +32,14 @@ export default {
return {
newsData2: [],
newsData: [],
newsData3: [],
showIndex: 1
}
},
mounted() {
this.getData(1)
this.getData(2)
this.getData(3)
},
methods: {
tap(n) {
......@@ -56,7 +62,7 @@ export default {
image: 'https://zws-imgs-pub.ezijing.com/static/public/b9045c3182307689d0371bece5b2bf3a.png'
}
]
} else {
} else if (n === 2) {
requestType = [
{
name: '硕士-项目简介',
......@@ -71,6 +77,21 @@ export default {
image: 'https://zws-imgs-pub.ezijing.com/static/public/b9045c3182307689d0371bece5b2bf3a.png'
}
]
} else {
requestType = [
{
name: '瑞士酒店管理大学',
image: 'https://zws-imgs-pub.ezijing.com/static/public/b9045c3182307689d0371bece5b2bf3a.png'
},
{
name: '瑞士恺撒里兹大学',
image: 'https://zws-imgs-pub.ezijing.com/static/public/b9045c3182307689d0371bece5b2bf3a.png'
},
{
name: '瑞士蒙特勒工商管理大学',
image: 'https://zws-imgs-pub.ezijing.com/static/public/b9045c3182307689d0371bece5b2bf3a.png'
}
]
}
requestType.map((item, index) => {
this.request(item, index, n)
......@@ -88,13 +109,21 @@ export default {
image: item.image
})
this.newsData = this.newsData.sort((a, b) => a.id - b.id)
} else {
} else if (n === 2) {
this.newsData2.push({
id: index,
title: item.name,
content: json === null ? '' : json[0].content,
image: item.image
})
this.newsData = this.newsData.sort((a, b) => a.id - b.id)
} else {
this.newsData3.push({
id: index,
title: item.name,
content: json === null ? '' : json[0].content,
image: item.image
})
this.newsData2 = this.newsData2.sort((a, b) => a.id - b.id)
}
})
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论