|
|
@@ -32,8 +32,8 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
- <span v-if="user.intro !== null">{{user.intro}}</span>
|
|
|
- <span v-if="user.intro === undefined || user.intro === null">此用户没有签名</span>
|
|
|
+ <span v-if="user.signature !== null">{{user.signature}}</span>
|
|
|
+ <span v-if="user.signature === undefined || user.signature === null">此用户没有签名</span>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<span class="el-icon-user">关注数: {{ user.followingCount }}</span>
|
|
|
@@ -47,28 +47,40 @@
|
|
|
<el-row>
|
|
|
<el-col :md="24" class="movie-list">
|
|
|
<el-tabs v-model="activeName" @tab-click='tabClick'>
|
|
|
- <el-tab-pane label="视频" name="video">
|
|
|
+ <el-tab-pane name="video">
|
|
|
+ <span slot="label">
|
|
|
+ 视频<el-badge :value="videoCount" :max="9999" class="item" type="warning"/>
|
|
|
+ </span>
|
|
|
<div v-if="activeName === 'video'">
|
|
|
<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 label="状态" name="status">
|
|
|
+ <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 label="Ta 的关注" name="following">
|
|
|
+ <el-tab-pane name="following">
|
|
|
+ <span slot="label">
|
|
|
+ Ta 的关注<el-badge :value="followingCount" :max="9999" class="item" type="warning"/>
|
|
|
+ </span>
|
|
|
<div v-if="activeName === 'following'">
|
|
|
<el-col v-for="(user, index) in followingList" :key="index" :md="6" :sm="12" :xs="12">
|
|
|
<user-card :user="user"></user-card>
|
|
|
</el-col>
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
|
- <el-tab-pane label="Ta 的粉丝" name="follower">
|
|
|
+ <el-tab-pane name="follower">
|
|
|
+ <span slot="label">
|
|
|
+ Ta 的粉丝<el-badge :value="followerCount" :max="9999" class="item" type="warning"/>
|
|
|
+ </span>
|
|
|
<div v-if="activeName === 'follower'">
|
|
|
<el-col v-for="(user, index) in followerList" :key="index" :md="6" :sm="12" :xs="12">
|
|
|
<user-card :user="user"></user-card>
|
|
|
@@ -105,7 +117,7 @@ import UserCard from '@/components/card/UserCard'
|
|
|
import StatusCard from '@/components/card/StatusCard'
|
|
|
import VideoCard from '@/components/card/VideoCard'
|
|
|
import { getUserInfo, getUserFollowing, getUserFollower, checkRelation, followUser, unfollowUser } from "@/api/user";
|
|
|
-import { userVideoList } from "@/api/video";
|
|
|
+import { userVideoList, getUserContentData } from "@/api/video";
|
|
|
import { userStatus } from "@/api/status";
|
|
|
|
|
|
export default {
|
|
|
@@ -129,10 +141,17 @@ export default {
|
|
|
statusList: [],
|
|
|
followerList: [],
|
|
|
followingList: [],
|
|
|
- showEmpty: false
|
|
|
+ showEmpty: false,
|
|
|
+ videoCount: 0,
|
|
|
+ statusCount: 0,
|
|
|
+ followingCount: 0,
|
|
|
+ followerCount: 0
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
+ const pageNumber = this.$route.params.pageNumber
|
|
|
+ const lastId = this.$route.params.lastId
|
|
|
+
|
|
|
this.userId = this.$route.params.id
|
|
|
getUserInfo(this.userId).then(res => {
|
|
|
if (res.code === 0) {
|
|
|
@@ -151,7 +170,16 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
|
|
|
- this.userVideoListWrapper(1, this.userId)
|
|
|
+ getUserContentData(this.userId).then(res => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ const resData = res.data
|
|
|
+ this.videoCount = resData.videoCount
|
|
|
+ this.statusCount = resData.statusCount
|
|
|
+ this.followingCount = resData.userFollowCount.followingCount
|
|
|
+ this.followerCount = resData.userFollowCount.followerCount
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.userVideoListWrapper(1, this.userId, 0)
|
|
|
},
|
|
|
mounted() {
|
|
|
// 当窗口宽度改变时获取屏幕宽度
|
|
|
@@ -165,15 +193,14 @@ export default {
|
|
|
methods: {
|
|
|
handleCurrentChange(pageNumber) {
|
|
|
this.currentPage = pageNumber
|
|
|
- this.$router.push({
|
|
|
+ /*this.$router.push({
|
|
|
path: '/user/' + this.userId + '?pageNumber=' + pageNumber + '&lastId=' + this.lastId,
|
|
|
query: {
|
|
|
pageNumber: this.currentPage,
|
|
|
lastId: this.lastId
|
|
|
}
|
|
|
- });
|
|
|
-
|
|
|
- // this.videoPageWrapper(this.currentPage, this.lastId)
|
|
|
+ });*/
|
|
|
+ this.userVideoListWrapper(this.currentPage, this.userId, this.lastId)
|
|
|
// 回到顶部
|
|
|
scrollTo(0, 0)
|
|
|
},
|
|
|
@@ -226,8 +253,8 @@ export default {
|
|
|
sendMessage(userId) {
|
|
|
console.log('发送消息')
|
|
|
},
|
|
|
- userVideoListWrapper(pageNumber, userId) {
|
|
|
- userVideoList(pageNumber, userId).then(res => {
|
|
|
+ userVideoListWrapper(pageNumber, userId, lastId) {
|
|
|
+ userVideoList(pageNumber, userId, lastId).then(res => {
|
|
|
if (res.code === 0) {
|
|
|
const resData = res.data
|
|
|
this.videoList = resData.list
|
|
|
@@ -272,4 +299,9 @@ export default {
|
|
|
padding-bottom: 100px;
|
|
|
text-align: center;
|
|
|
}
|
|
|
+
|
|
|
+.item {
|
|
|
+ margin-top: 10px;
|
|
|
+ margin-right: 40px;
|
|
|
+}
|
|
|
</style>
|