|
@@ -7,7 +7,7 @@
|
|
|
<el-row>
|
|
<el-row>
|
|
|
<el-col :md="1">
|
|
<el-col :md="1">
|
|
|
<el-avatar>
|
|
<el-avatar>
|
|
|
- <el-image :src="user.avatarUrl" />
|
|
|
|
|
|
|
+ <el-image :src="user.avatarUrl"/>
|
|
|
</el-avatar>
|
|
</el-avatar>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :md="23">
|
|
<el-col :md="23">
|
|
@@ -36,13 +36,9 @@
|
|
|
<span v-if="user.signature === undefined || user.signature === null">此用户没有签名</span>
|
|
<span v-if="user.signature === undefined || user.signature === null">此用户没有签名</span>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
<el-row>
|
|
<el-row>
|
|
|
- <router-link target="_blank" :to="`/user/${user.userId}/following`">
|
|
|
|
|
- <span class="el-icon-user">关注数: {{ user.followingCount }}</span>
|
|
|
|
|
- </router-link>
|
|
|
|
|
|
|
+ <span class="el-icon-user">关注数: {{ user.followingCount }}</span>
|
|
|
<span v-html="' '" />
|
|
<span v-html="' '" />
|
|
|
- <router-link target="_blank" :to="`/user/${user.userId}/follower`">
|
|
|
|
|
- <span class="el-icon-user">粉丝数: {{ user.followerCount }}</span>
|
|
|
|
|
- </router-link>
|
|
|
|
|
|
|
+ <span class="el-icon-user">粉丝数: {{ user.followerCount }}</span>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
</div>
|
|
</div>
|
|
|
</el-card>
|
|
</el-card>
|
|
@@ -51,6 +47,16 @@
|
|
|
<el-row>
|
|
<el-row>
|
|
|
<el-col :md="24" class="movie-list">
|
|
<el-col :md="24" class="movie-list">
|
|
|
<el-tabs v-model="activeName" @tab-click='tabClick'>
|
|
<el-tabs v-model="activeName" @tab-click='tabClick'>
|
|
|
|
|
+ <el-tab-pane name="status">
|
|
|
|
|
+ <span slot="label">
|
|
|
|
|
+ 状态<el-badge :value="statusCount" :max="9999" class="item" type="warning"/>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ <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-tab-pane name="video">
|
|
<el-tab-pane name="video">
|
|
|
<span slot="label">
|
|
<span slot="label">
|
|
|
视频<el-badge :value="videoCount" :max="9999" class="item" type="warning"/>
|
|
视频<el-badge :value="videoCount" :max="9999" class="item" type="warning"/>
|
|
@@ -71,14 +77,24 @@
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</div>
|
|
</div>
|
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
|
- <el-tab-pane name="status">
|
|
|
|
|
|
|
+ <el-tab-pane name="audio">
|
|
|
<span slot="label">
|
|
<span slot="label">
|
|
|
- 状态<el-badge :value="statusCount" :max="9999" class="item" type="warning"/>
|
|
|
|
|
|
|
+ 音频<el-badge :value="videoCount" :max="9999" class="item" type="warning"/>
|
|
|
</span>
|
|
</span>
|
|
|
- <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 v-if="activeName === 'audio'">
|
|
|
|
|
+ <el-col v-for="(video, index) in videoList" :key="index" :md="6" :sm="12" :xs="12">
|
|
|
|
|
+ <video-card :video="video" />
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-tab-pane>
|
|
|
|
|
+ <el-tab-pane name="article">
|
|
|
|
|
+ <span slot="label">
|
|
|
|
|
+ 文章<el-badge :value="videoCount" :max="9999" class="item" type="warning"/>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ <div v-if="activeName === 'article'">
|
|
|
|
|
+ <el-col v-for="(video, index) in videoList" :key="index" :md="6" :sm="12" :xs="12">
|
|
|
|
|
+ <video-card :video="video" />
|
|
|
|
|
+ </el-col>
|
|
|
</div>
|
|
</div>
|
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
|
<el-tab-pane name="following">
|
|
<el-tab-pane name="following">
|
|
@@ -149,7 +165,7 @@ export default {
|
|
|
icon: 'el-icon-plus',
|
|
icon: 'el-icon-plus',
|
|
|
text: '关注'
|
|
text: '关注'
|
|
|
},
|
|
},
|
|
|
- activeName: 'video',
|
|
|
|
|
|
|
+ activeName: 'status',
|
|
|
currentPage: 1,
|
|
currentPage: 1,
|
|
|
pageSize: 12,
|
|
pageSize: 12,
|
|
|
totalSize: 0,
|
|
totalSize: 0,
|
|
@@ -169,7 +185,28 @@ export default {
|
|
|
getUserInfo(this.userId).then(res => {
|
|
getUserInfo(this.userId).then(res => {
|
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
|
this.user = res.data
|
|
this.user = res.data
|
|
|
- document.title = this.user.screenName + '的个人主页'
|
|
|
|
|
|
|
+ const path = this.$route.path
|
|
|
|
|
+ if (path.endsWith("video")) {
|
|
|
|
|
+ this.activeName = 'video'
|
|
|
|
|
+ document.title = this.user.screenName + '的视频'
|
|
|
|
|
+ } else if (path.endsWith("image")) {
|
|
|
|
|
+ this.activeName = 'image'
|
|
|
|
|
+ document.title = this.user.screenName + '的相册'
|
|
|
|
|
+ } else if (path.endsWith("audio")) {
|
|
|
|
|
+ this.activeName = 'audio'
|
|
|
|
|
+ document.title = this.user.screenName + '的音频'
|
|
|
|
|
+ } else if (path.endsWith("article")) {
|
|
|
|
|
+ this.activeName = 'article'
|
|
|
|
|
+ document.title = this.user.screenName + '的文章'
|
|
|
|
|
+ } else if (path.endsWith("following")) {
|
|
|
|
|
+ this.activeName = 'following'
|
|
|
|
|
+ document.title = this.user.screenName + '的关注'
|
|
|
|
|
+ } else if (path.endsWith("follower")) {
|
|
|
|
|
+ this.activeName = 'follower'
|
|
|
|
|
+ document.title = this.user.screenName + '的粉丝'
|
|
|
|
|
+ } else {
|
|
|
|
|
+ document.title = this.user.screenName + '的个人主页'
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
|
|
@@ -202,6 +239,11 @@ export default {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ watch: {
|
|
|
|
|
+ $route(){
|
|
|
|
|
+ this.$router.go()
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
methods: {
|
|
methods: {
|
|
|
initPagination() {
|
|
initPagination() {
|
|
|
this.pageSize = 12
|
|
this.pageSize = 12
|
|
@@ -233,7 +275,68 @@ export default {
|
|
|
},
|
|
},
|
|
|
tabClick(tab) {
|
|
tabClick(tab) {
|
|
|
this.activeName = tab.name
|
|
this.activeName = tab.name
|
|
|
- if (this.activeName === 'video') {
|
|
|
|
|
|
|
+ if (this.activeName === 'status') {
|
|
|
|
|
+ const path = '/user/' + this.userId
|
|
|
|
|
+ if (this.$route.path === path) {
|
|
|
|
|
+ this.$router.go(0)
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$router.push(path)
|
|
|
|
|
+
|
|
|
|
|
+ /*this.currentPage = 1
|
|
|
|
|
+ this.lastId = 0
|
|
|
|
|
+ this.userStatusListWrapper(this.currentPage, this.userId, this.lastId)*/
|
|
|
|
|
+ } else if (this.activeName === 'video') {
|
|
|
|
|
+ this.goToTab(this.activeName)
|
|
|
|
|
+ /*this.currentPage = 1
|
|
|
|
|
+ this.lastId = 0
|
|
|
|
|
+ this.userVideoListWrapper(this.currentPage, this.userId, this.lastId)*/
|
|
|
|
|
+ } else if (this.activeName === 'image') {
|
|
|
|
|
+ this.goToTab(this.activeName)
|
|
|
|
|
+ /*this.currentPage = 1
|
|
|
|
|
+ this.lastId = 0
|
|
|
|
|
+ this.userVideoListWrapper(this.currentPage, this.userId, this.lastId)*/
|
|
|
|
|
+ } else if (this.activeName === 'audio') {
|
|
|
|
|
+ this.goToTab(this.activeName)
|
|
|
|
|
+ /*this.currentPage = 1
|
|
|
|
|
+ this.lastId = 0
|
|
|
|
|
+ this.userVideoListWrapper(this.currentPage, this.userId, this.lastId)*/
|
|
|
|
|
+ } else if (this.activeName === 'article') {
|
|
|
|
|
+ this.goToTab(this.activeName)
|
|
|
|
|
+ /*this.currentPage = 1
|
|
|
|
|
+ this.lastId = 0
|
|
|
|
|
+ this.userVideoListWrapper(this.currentPage, this.userId, this.lastId)*/
|
|
|
|
|
+ } else if (this.activeName === 'following') {
|
|
|
|
|
+ this.goToTab(this.activeName)
|
|
|
|
|
+ /*getUserFollowing(this.userId).then(res => {
|
|
|
|
|
+ if (res.code === 0) {
|
|
|
|
|
+ this.followingList = res.data
|
|
|
|
|
+ }
|
|
|
|
|
+ })*/
|
|
|
|
|
+ } else if (this.activeName === 'follower') {
|
|
|
|
|
+ this.goToTab(this.activeName)
|
|
|
|
|
+ /*getUserFollower(this.userId).then(res => {
|
|
|
|
|
+ if (res.code === 0) {
|
|
|
|
|
+ this.followerList = res.data
|
|
|
|
|
+ }
|
|
|
|
|
+ })*/
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ goToTab(activeName) {
|
|
|
|
|
+ const path = '/user/' + this.userId + '/' + activeName
|
|
|
|
|
+ if (this.$route.path === path) {
|
|
|
|
|
+ this.$router.go(0)
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$router.push(path)
|
|
|
|
|
+ },
|
|
|
|
|
+ getData() {
|
|
|
|
|
+ this.activeName = tab.name
|
|
|
|
|
+ if (this.activeName === 'status') {
|
|
|
|
|
+ this.currentPage = 1
|
|
|
|
|
+ this.lastId = 0
|
|
|
|
|
+ this.userStatusListWrapper(this.currentPage, this.userId, this.lastId)
|
|
|
|
|
+ } else if (this.activeName === 'video') {
|
|
|
this.currentPage = 1
|
|
this.currentPage = 1
|
|
|
this.lastId = 0
|
|
this.lastId = 0
|
|
|
this.userVideoListWrapper(this.currentPage, this.userId, this.lastId)
|
|
this.userVideoListWrapper(this.currentPage, this.userId, this.lastId)
|
|
@@ -241,10 +344,14 @@ export default {
|
|
|
this.currentPage = 1
|
|
this.currentPage = 1
|
|
|
this.lastId = 0
|
|
this.lastId = 0
|
|
|
this.userVideoListWrapper(this.currentPage, this.userId, this.lastId)
|
|
this.userVideoListWrapper(this.currentPage, this.userId, this.lastId)
|
|
|
- } else if (this.activeName === 'status') {
|
|
|
|
|
|
|
+ } else if (this.activeName === 'audio') {
|
|
|
this.currentPage = 1
|
|
this.currentPage = 1
|
|
|
this.lastId = 0
|
|
this.lastId = 0
|
|
|
- this.userStatusListWrapper(this.currentPage, this.userId, this.lastId)
|
|
|
|
|
|
|
+ this.userVideoListWrapper(this.currentPage, this.userId, this.lastId)
|
|
|
|
|
+ } else if (this.activeName === 'article') {
|
|
|
|
|
+ this.currentPage = 1
|
|
|
|
|
+ this.lastId = 0
|
|
|
|
|
+ this.userVideoListWrapper(this.currentPage, this.userId, this.lastId)
|
|
|
} else if (this.activeName === 'following') {
|
|
} else if (this.activeName === 'following') {
|
|
|
getUserFollowing(this.userId).then(res => {
|
|
getUserFollowing(this.userId).then(res => {
|
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|