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

修改样式

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