|
|
@@ -1,16 +1,34 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <el-row>
|
|
|
+ <el-row class="movie-list">
|
|
|
<el-col :md="18">
|
|
|
<text-card />
|
|
|
</el-col>
|
|
|
- <el-col :md="6">
|
|
|
+<!-- <el-col :md="6">
|
|
|
<hot-list />
|
|
|
- </el-col>
|
|
|
+ </el-col>-->
|
|
|
</el-row>
|
|
|
- <el-row id="movie-list">
|
|
|
+ <el-row class="movie-list">
|
|
|
+ <el-col :md="18">
|
|
|
+ <el-tabs v-model="activeName" @tab-click='tabClick'>
|
|
|
+ <el-tab-pane label="视频" name="video">
|
|
|
+ <div v-if="activeName === 'video'">
|
|
|
+ <el-row v-for="(video, index) in videoList" :key="index" :md="6" :sm="12" :xs="12">
|
|
|
+ <video-card :video="video" />
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="状态" name="status">
|
|
|
+ <div v-if="activeName === 'status'">
|
|
|
+ <el-row v-for="(status, index) in statusList" :key="index" :md="16" :sm="12" :xs="12">
|
|
|
+ <status-card :status="status" />
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+ </el-col>
|
|
|
<el-col :md="18">
|
|
|
- <el-row v-for="(video, index) in videoList" :key="index" :md="16" :sm="12" :xs="12">
|
|
|
+ <el-row v-for="(video, index) in statusList" :key="index" :md="16" :sm="12" :xs="12">
|
|
|
<status-card :status="video" />
|
|
|
</el-row>
|
|
|
</el-col>
|
|
|
@@ -21,20 +39,23 @@
|
|
|
<script>
|
|
|
import TextCard from '@/components/card/TextCard'
|
|
|
import StatusCard from '@/components/card/StatusCard'
|
|
|
+import VideoCard from '@/components/card/VideoCard'
|
|
|
import HotList from '@/components/hotlist/HotList'
|
|
|
import { getUserInfo } from '@/utils/auth'
|
|
|
-import { statusRecommend } from '@/api/status'
|
|
|
+import { statusTimeline, videoTimeline } from '@/api/timeline'
|
|
|
|
|
|
export default {
|
|
|
name: 'Status',
|
|
|
- components: { TextCard, StatusCard, HotList },
|
|
|
+ components: { TextCard, StatusCard, VideoCard, HotList },
|
|
|
data() {
|
|
|
return {
|
|
|
// 屏幕宽度, 为了控制分页条的大小
|
|
|
screenWidth: document.body.clientWidth,
|
|
|
currentPage: 1,
|
|
|
videoInfo: null,
|
|
|
- videoList: []
|
|
|
+ statusList: [],
|
|
|
+ videoList: [],
|
|
|
+ activeName: 'video'
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
@@ -44,12 +65,13 @@ export default {
|
|
|
}
|
|
|
|
|
|
this.currentPage = 1
|
|
|
- statusRecommend(this.currentPage).then(res => {
|
|
|
+ this.videoTimelineWrapper(this.currentPage)
|
|
|
+ /*statusTimeline(0, this.currentPage).then(res => {
|
|
|
if (res.code === 0) {
|
|
|
const resData = res.data
|
|
|
- this.videoList = resData.list
|
|
|
+ this.statusList = resData.list
|
|
|
}
|
|
|
- })
|
|
|
+ })*/
|
|
|
},
|
|
|
mounted() {
|
|
|
// 当窗口宽度改变时获取屏幕宽度
|
|
|
@@ -67,13 +89,37 @@ export default {
|
|
|
this.$store.dispatch('getPageBean')
|
|
|
// 回到顶部
|
|
|
scrollTo(0, 0)
|
|
|
+ },
|
|
|
+ statusTimelineWrapper(pageNumber) {
|
|
|
+ statusTimeline(0, this.currentPage).then(res => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ const resData = res.data
|
|
|
+ this.statusList = resData.list
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ videoTimelineWrapper(pageNumber) {
|
|
|
+ videoTimeline(0, this.currentPage).then(res => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ const resData = res.data
|
|
|
+ this.videoList = resData.list
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ tabClick(tab) {
|
|
|
+ const tabName = tab.name
|
|
|
+ if (tabName === 'video') {
|
|
|
+ this.videoTimelineWrapper(this.currentPage)
|
|
|
+ } else if (tabName === 'status') {
|
|
|
+ this.statusTimelineWrapper(this.currentPage)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
-#movie-list {
|
|
|
+.movie-list {
|
|
|
padding-top: 15px;
|
|
|
padding-left: 3%;
|
|
|
padding-right: 3%;
|
|
|
@@ -81,7 +127,7 @@ export default {
|
|
|
|
|
|
/*处于手机屏幕时*/
|
|
|
@media screen and (max-width: 768px){
|
|
|
- #movie-list {
|
|
|
+ .movie-list {
|
|
|
padding-top: 8px;
|
|
|
padding-left: 0.5%;
|
|
|
padding-right: 0.5%;
|