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

修改样式

上级 aec13b30
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
></banner-tab> ></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>
...@@ -34,19 +35,31 @@ export default { ...@@ -34,19 +35,31 @@ export default {
type: 58, type: 58,
project_id: 1007 project_id: 1007
}, },
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() {
cAction.reportAction.getNews(this.requestParam).then(json => { 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) }).finally(() => {}) }).catch(e => { this.$message.error(e.message) }).finally(() => {})
} }
}, },
......
...@@ -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() {
......
...@@ -8,8 +8,17 @@ ...@@ -8,8 +8,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>
...@@ -17,31 +26,26 @@ ...@@ -17,31 +26,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: ['宣讲会实录', '项目介绍'],
...@@ -49,26 +53,63 @@ export default { ...@@ -49,26 +53,63 @@ export default {
requestParam: { requestParam: {
page: 1, page: 1,
per_page: 100, per_page: 100,
type: 50, type: 52,
project_id: 1007 project_id: 1007
} }
} }
}, },
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.getNews(this.requestParam).then(json => { 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) }).finally(() => {}) }).catch(e => { this.$message.error(e.message) }).finally(() => {})
} }
}, },
mounted() { mounted() {
this.getData()
// this.request(50) // this.request(50)
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论