提交 a09a006a authored 作者: lihuihui's avatar lihuihui

修改样式

上级 5e471a60
......@@ -41,9 +41,9 @@ export default {
},
methods: {
tab(index, title) {
if(this.$route.path === '/presence' && title === '学生风采') {
this.$router.push({ path: '/index' })
}
// if(this.$route.path === '/presence' && title === '学生风采') {
// this.$router.push({ path: '/index' })
// }
this.activeIndex = index
this.$emit('changeTab', this.activeIndex)
}
......
......@@ -3,7 +3,8 @@
<banner-tab :data="bannerTabData" @changeTab="changeTab"></banner-tab>
<div class="pre-mian center97">
<div class="list-box">
<list :data="listData"></list>
<list :data="listData[0]" v-if="activeIndex == 0"></list>
<list :data="listData[1]" v-if="activeIndex == 1"></list>
</div>
<img src="https://zws-imgs-pub.ezijing.com/static/public/d92feb882caacd44d18f05c996494f14.png" alt="" />
</div>
......@@ -31,21 +32,33 @@ export default {
type: 58,
project_id: 1001
},
listData: []
listData: {
0: [],
1: []
}
}
},
mounted() {
this.request()
this.request(0)
},
methods: {
changeTab(index) {
const key = {
0: 58,
1: 54
}
this.requestParam.type = key[index]
this.request(index)
this.activeIndex = index
},
request() {
request(n) {
cAction.reportAction
.getNews(this.requestParam)
.then(json => {
this.listData = json
if (Array.isArray(json)) {
json.length && (this.listData[n] = json)
console.log(this.listData)
}
})
.catch(e => {
this.$message.error(e.message)
......
......@@ -61,7 +61,7 @@ export default {
},
goPage() {
this.$router.push({
path: '/signup/index'
path: '/my'
})
},
changeChildTab(index) {
......
......@@ -38,7 +38,7 @@ export default {
methods: {
goPage() {
this.$router.push({
path: '/signup/index'
path: '/my'
})
},
getData() {
......
......@@ -5,8 +5,17 @@
<div class="module" v-if="activeIndex == 0">
<news :data="newsData"></news>
</div>
<div class="module wid" v-if="activeIndex !== 0">
<div class="no-data">暂无数据</div>
<div class="module" v-if="activeIndex === 1">
<list :data="listData[1]"></list>
<div class="no-data" v-if="!listData[1].length">暂无数据</div>
</div>
<div class="module" v-if="activeIndex === 2">
<list :data="listData[2]"></list>
<div class="no-data" v-if="!listData[2].length">暂无数据</div>
</div>
<div class="module" v-if="activeIndex === 3">
<list :data="listData[3]"></list>
<div class="no-data" v-if="!listData[3].length">暂无数据</div>
</div>
</div>
</div>
......@@ -14,31 +23,26 @@
<script>
import news from '@/components/news/news.vue'
import bannerTab from '@/components/news/tab/bannerTab.vue'
import list from '@/components/news/newsList.vue'
import cAction from '@action'
export default {
components: {
bannerTab,
news
news,
list
},
data() {
return {
listData: {
1: [],
2: [],
3: []
},
bannerTabData: {
menu: ['项目介绍', '宣传片', '教授采访', '学生风采'],
imgUrl: 'https://zws-imgs-pub.ezijing.com/static/public/24c97bb61b77949b415adcb06c7e43b1.png'
},
newsData: [
{
id: 0,
title: '宣讲会实录',
content: '',
image: 'https://zws-imgs-pub.ezijing.com/static/build/learn-mba/resources/m2-r-img.b002ecd2.png'
},
{
id: 1,
title: '项目介绍',
content: '',
image: 'https://zws-imgs-pub.ezijing.com/static/build/learn-mba/resources/m2-r-img.b002ecd2.png'
}
],
activeIndex: 0,
tabMenu: ['宣讲会实录', '项目介绍'],
......@@ -46,24 +50,60 @@ export default {
requestParam: {
page: 1,
per_page: 100,
type: 50,
type: 52,
project_id: 1001
}
}
},
methods: {
changeTab(index) {
const key = {
1: 52,
2: 53,
3: 54
}
if (index) {
this.requestParam.type = key[index]
this.requestList(index)
}
this.activeIndex = index
},
changeChildTab(index) {
this.childActiveIndex = index
},
request(n) {
this.requestParam.type = n
getData() {
const requestType = [
{
name: '宣讲会实录',
image: 'https://zws-imgs-pub.ezijing.com/static/public/09a620add2643574f9f0de4424db5ebe.png'
},
{
name: '项目介绍',
image: 'https://zws-imgs-pub.ezijing.com/static/public/09a620add2643574f9f0de4424db5ebe.png'
}
]
requestType.map((item, index) => {
this.request(item, index)
})
},
request(item, index) {
cAction.reportAction.getContent(item.name).then(json => {
this.newsData.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)
}).catch(e => { this.$message.error(e.message) }).finally(() => {})
},
requestList(n) {
cAction.reportAction
.getNews(this.requestParam)
.then(json => {
this.listData = json
if (Array.isArray(json)) {
json.length && (this.listData[n] = json)
}
})
.catch(e => {
this.$message.error(e.message)
......@@ -72,7 +112,7 @@ export default {
}
},
mounted() {
// this.request(50)
this.getData()
}
}
</script>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论