Commit 32fc7f3f by yanju

Merge branch 'new-func#1' into 'master'

主页服务端渲染

See merge request pigbigbig/beyond-clouds-front!116
parents ccff5390 c43e9007
...@@ -60,7 +60,27 @@ ...@@ -60,7 +60,27 @@
} }
}); });
return {blogList:blogList.data.dataList,projectList:projectList.data.dataList} let newsList = await $axios.$get(config.api.get.Content.list + '/13/contents',
{
params: {
page: 1,
size: 5,
type: 1}
})
let bannerList = await $axios.$get(config.api.get.Content.list + '/12/contents',
{
params: {
page: 1,
size: 5,
type: 0
}
})
return {blogList:blogList.data.dataList,
projectList:projectList.data.dataList,
bannerList:bannerList.data.dataList,
newsList:newsList.data.dataList}
}, },
data(){ data(){
return{ return{
...@@ -75,7 +95,6 @@ ...@@ -75,7 +95,6 @@
created() { created() {
this.dataGetHotBloggersList(); this.dataGetHotBloggersList();
this.dataGetHotAnswerList(); this.dataGetHotAnswerList();
this.dataGetNewsList();
this.dataGetBanner(); this.dataGetBanner();
}, },
...@@ -98,17 +117,7 @@ ...@@ -98,17 +117,7 @@
}, },
dataGetBanner(){ //内容类型-0:幻灯,1:普通文章,3:广告 dataGetBanner(){ //内容类型-0:幻灯,1:普通文章,3:广告
let dataList = this.bannerList;
let params = {
page: 1,
size: 5,
type: 0
};
this.$axios.$get(config.api.get.Content.list + '/12/contents',
{
params: params
}).then((response) => {
let dataList = response.data.dataList;
dataList.map((val,index)=>{ dataList.map((val,index)=>{
this.imgArr.push( this.imgArr.push(
val.pic1 val.pic1
...@@ -117,7 +126,7 @@ ...@@ -117,7 +126,7 @@
val.link val.link
) )
}) })
})
}, },
dataGetHotBloggersList() { dataGetHotBloggersList() {
...@@ -142,19 +151,6 @@ ...@@ -142,19 +151,6 @@
}); });
}, },
dataGetNewsList() {
let params = {
page: 1,
size: 5,
type: 1
};
this.$axios.$get(config.api.get.Content.list + '/13/contents',
{
params: params
}).then((response) => {
this.newsList = response.data.dataList;
})
},
}, },
mounted(){ mounted(){
} }
......
<template>
<yun-video></yun-video>
</template>
<script>
import YunVideo from '../components/common/video/src/main.vue';
export default {
components:{
YunVideo
},
data(){
return{
}
},
props:{
},
}
</script>
<style lang="scss" scoped>
.container{
width:$pageWidth;
margin:0 auto;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment