|
|
@@ -7,7 +7,7 @@
|
|
|
<el-row>
|
|
|
<el-col :md="1">
|
|
|
<el-avatar>
|
|
|
- <el-image :src="user.avatarUrl"/>
|
|
|
+ <el-image :src="user.avatarUrl" />
|
|
|
</el-avatar>
|
|
|
</el-col>
|
|
|
<el-col :md="23">
|
|
|
@@ -19,7 +19,7 @@
|
|
|
:icon="followButton.icon"
|
|
|
@click="followUser(user.userId)"
|
|
|
>
|
|
|
- <span>{{followButton.text}}</span>
|
|
|
+ <span>{{ followButton.text }}</span>
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
type="danger"
|
|
|
@@ -32,8 +32,7 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
- <span v-if="user.signature !== null" v-html="user.signature">
|
|
|
- </span>
|
|
|
+ <span v-if="user.signature !== null" v-html="user.signature" />
|
|
|
<span v-if="user.signature === undefined || user.signature === null">-</span>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
@@ -52,10 +51,10 @@
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<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="video">
|
|
|
<span slot="label">
|
|
|
- 视频<el-badge :value="userContentData.videoCount" :max="9999" class="item" type="warning"/>
|
|
|
+ 视频<el-badge :value="userContentData.videoCount" :max="9999" class="item" type="warning" />
|
|
|
</span>
|
|
|
<div v-if="activeName === 'video'">
|
|
|
<el-col v-for="(video, index) in dataList" :key="index" :md="6" :sm="12" :xs="12">
|
|
|
@@ -65,27 +64,27 @@
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane name="audio">
|
|
|
<span slot="label">
|
|
|
- 音频<el-badge :value="userContentData.audioCount" :max="9999" class="item" type="warning"/>
|
|
|
+ 音频<el-badge :value="userContentData.audioCount" :max="9999" class="item" type="warning" />
|
|
|
</span>
|
|
|
<div v-if="activeName === 'audio'">
|
|
|
<el-col v-for="(audio, index) in dataList" :key="index" :md="6" :sm="12" :xs="12">
|
|
|
- <audio-card :audio="audio"/>
|
|
|
+ <audio-card :audio="audio" />
|
|
|
</el-col>
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane name="image">
|
|
|
<span slot="label">
|
|
|
- 相册<el-badge :value="userContentData.albumCount" :max="9999" class="item" type="warning"/>
|
|
|
+ 相册<el-badge :value="userContentData.albumCount" :max="9999" class="item" type="warning" />
|
|
|
</span>
|
|
|
<div v-if="activeName === 'image'">
|
|
|
<el-col v-for="(album, index) in dataList" :key="index" :md="6" :sm="12" :xs="12">
|
|
|
- <image-album-card :imageAlbum="album" />
|
|
|
+ <image-album-card :image-album="album" />
|
|
|
</el-col>
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane name="article">
|
|
|
<span slot="label">
|
|
|
- 文章<el-badge :value="userContentData.articleCount" :max="9999" class="item" type="warning"/>
|
|
|
+ 文章<el-badge :value="userContentData.articleCount" :max="9999" class="item" type="warning" />
|
|
|
</span>
|
|
|
<div v-if="activeName === 'article'">
|
|
|
<el-col v-for="(article, index) in dataList" :key="index" :md="6" :sm="12" :xs="12">
|
|
|
@@ -93,7 +92,7 @@
|
|
|
</el-col>
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
|
-<!-- <el-tab-pane name="status">
|
|
|
+ <!-- <el-tab-pane name="status">
|
|
|
<span slot="label">
|
|
|
状态<el-badge :value="userContentData.statusCount" :max="9999" class="item" type="warning"/>
|
|
|
</span>
|
|
|
@@ -138,12 +137,12 @@ import AudioCard from '@/components/card/AudioCard'
|
|
|
import ImageAlbumCard from '@/components/card/ImageAlbumCard'
|
|
|
import ArticleCard from '@/components/card/ArticleCard'
|
|
|
|
|
|
-import { getUserInfo, checkRelation, followUser, unfollowUser } from "@/api/user";
|
|
|
-import { getUserContentData, getUserVideos } from "@/api/video";
|
|
|
-import { getUserAlbums1 } from "@/api/image";
|
|
|
-import { getUserAudios } from "@/api/audio";
|
|
|
-import { getUserArticles } from "@/api/article";
|
|
|
-import { userStatus } from "@/api/status";
|
|
|
+import { getUserInfo, checkRelation, followUser, unfollowUser } from '@/api/user'
|
|
|
+import { getUserContentData, getUserVideos } from '@/api/video'
|
|
|
+import { getUserAlbums1 } from '@/api/image'
|
|
|
+import { getUserAudios } from '@/api/audio'
|
|
|
+import { getUserArticles } from '@/api/article'
|
|
|
+import { userStatus } from '@/api/status'
|
|
|
|
|
|
export default {
|
|
|
name: 'Home',
|
|
|
@@ -167,25 +166,30 @@ export default {
|
|
|
userContentData: null
|
|
|
}
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ $route() {
|
|
|
+ this.$router.go()
|
|
|
+ }
|
|
|
+ },
|
|
|
created() {
|
|
|
this.userId = this.$route.params.id
|
|
|
getUserInfo(this.userId).then(resp => {
|
|
|
if (resp.code === 0) {
|
|
|
this.user = resp.data
|
|
|
const path = this.$route.path
|
|
|
- if (path.endsWith("video")) {
|
|
|
+ if (path.endsWith('video')) {
|
|
|
this.activeName = 'video'
|
|
|
document.title = this.user.screenName + '的视频'
|
|
|
- } else if (path.endsWith("image")) {
|
|
|
+ } else if (path.endsWith('image')) {
|
|
|
this.activeName = 'image'
|
|
|
document.title = this.user.screenName + '的相册'
|
|
|
- } else if (path.endsWith("audio")) {
|
|
|
+ } else if (path.endsWith('audio')) {
|
|
|
this.activeName = 'audio'
|
|
|
document.title = this.user.screenName + '的音频'
|
|
|
- } else if (path.endsWith("article")) {
|
|
|
+ } else if (path.endsWith('article')) {
|
|
|
this.activeName = 'article'
|
|
|
document.title = this.user.screenName + '的文章'
|
|
|
- } else if (path.endsWith("status")) {
|
|
|
+ } else if (path.endsWith('status')) {
|
|
|
this.activeName = 'status'
|
|
|
document.title = this.user.screenName + '的状态'
|
|
|
} else {
|
|
|
@@ -217,11 +221,6 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- watch: {
|
|
|
- $route(){
|
|
|
- this.$router.go()
|
|
|
- }
|
|
|
- },
|
|
|
methods: {
|
|
|
followUser(userId) {
|
|
|
if (this.followButton.text === '关注') {
|