|
|
@@ -1,79 +1,46 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<el-row>
|
|
|
- <el-col :md="3">
|
|
|
- <hot-list />
|
|
|
- </el-col>
|
|
|
<el-col :md="18">
|
|
|
- <el-row class="movie-list">
|
|
|
- <text-card />
|
|
|
- </el-row>
|
|
|
- <el-row class="movie-list">
|
|
|
- <el-tabs v-model="activeName" @tab-click='tabClick'>
|
|
|
- <el-tab-pane label="视频" name="video">
|
|
|
- <div v-if="activeName === 'video'">
|
|
|
- <el-col :md="8">
|
|
|
- <el-row v-for="(video, index) in videoList" :key="index" :md="6" :sm="12" :xs="12">
|
|
|
- <video-card :video="video" />
|
|
|
- </el-row>
|
|
|
- </el-col>
|
|
|
- </div>
|
|
|
- </el-tab-pane>
|
|
|
- <el-tab-pane label="状态" name="status">
|
|
|
- <div v-if="activeName === 'status'">
|
|
|
- <el-col :md="15">
|
|
|
- <el-row v-for="(status, index) in statusList" :key="index" :md="15" :sm="12" :xs="12">
|
|
|
- <status-card :status="status" />
|
|
|
- </el-row>
|
|
|
- </el-col>
|
|
|
- </div>
|
|
|
- </el-tab-pane>
|
|
|
- </el-tabs>
|
|
|
+ <el-row v-if="status !== null" class="movie-list">
|
|
|
+ <status-card :status="status" />
|
|
|
</el-row>
|
|
|
</el-col>
|
|
|
- <el-col :md="3">
|
|
|
- <hot-list />
|
|
|
- </el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<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 { statusTimeline, videoTimeline } from '@/api/timeline'
|
|
|
+import { getUserStatus } from '@/api/status'
|
|
|
|
|
|
export default {
|
|
|
name: 'Status',
|
|
|
- components: { TextCard, StatusCard, VideoCard, HotList },
|
|
|
+ components: { StatusCard },
|
|
|
data() {
|
|
|
return {
|
|
|
// 屏幕宽度, 为了控制分页条的大小
|
|
|
screenWidth: document.body.clientWidth,
|
|
|
- currentPage: 1,
|
|
|
- videoInfo: null,
|
|
|
- statusList: [],
|
|
|
- videoList: [],
|
|
|
- activeName: 'video'
|
|
|
+ nextId: 0,
|
|
|
+ status: null
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
+ const path = this.$route.path
|
|
|
+ const arr = path.split('/')
|
|
|
+ const statusId = parseInt(arr[3])
|
|
|
+
|
|
|
const userInfo = getUserInfo()
|
|
|
if (userInfo != null) {
|
|
|
- document.title = userInfo.username + '的时间线'
|
|
|
+ document.title = userInfo.screenName + '的状态'
|
|
|
}
|
|
|
|
|
|
- this.currentPage = 1
|
|
|
- this.videoTimelineWrapper(this.currentPage)
|
|
|
- /*statusTimeline(0, this.currentPage).then(res => {
|
|
|
+ getUserStatus(statusId).then(res => {
|
|
|
if (res.code === 0) {
|
|
|
- const resData = res.data
|
|
|
- this.statusList = resData.list
|
|
|
+ this.status = res.data
|
|
|
}
|
|
|
- })*/
|
|
|
+ })
|
|
|
},
|
|
|
mounted() {
|
|
|
// 当窗口宽度改变时获取屏幕宽度
|
|
|
@@ -85,36 +52,11 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- handleCurrentChange(currentPage) {
|
|
|
- this.currentPage = currentPage
|
|
|
- this.$store.commit('updatePage', currentPage)
|
|
|
- this.$store.dispatch('getPageBean')
|
|
|
- // 回到顶部
|
|
|
- scrollTo(0, 0)
|
|
|
- },
|
|
|
- statusTimelineWrapper(pageNumber) {
|
|
|
- statusTimeline(0, this.currentPage).then(res => {
|
|
|
+ statusTimelineWrapper(nextId) {
|
|
|
+ statusTimeline(nextId).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)
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
}
|