|
|
@@ -1,99 +1,175 @@
|
|
|
<template>
|
|
|
<div class="container">
|
|
|
- <div class="top"></div>
|
|
|
- <!-- <img class="top" :src="userInfo.avatar" alt="" /> -->
|
|
|
- <div class="top1">
|
|
|
- <div class="title">
|
|
|
- <div class="text">
|
|
|
- <div
|
|
|
- class="text2"
|
|
|
- @click="tab(item)"
|
|
|
- v-for="(item, index) in tabs"
|
|
|
- :key="index"
|
|
|
- :class="{ active: active === item }"
|
|
|
- >
|
|
|
- <div v-if="item === '粉丝'" class="text3">{{ userInfo.followers }}</div>
|
|
|
- <div v-if="item === '关注'" class="text3">{{ userInfo.follows }}</div>
|
|
|
- {{ item }}
|
|
|
+ <div class="border"></div>
|
|
|
+ <div class="content">
|
|
|
+ <el-empty v-if="empty" description="还没有粉丝哦~"></el-empty>
|
|
|
+ <div class="box" v-else>
|
|
|
+ <router-link :to="{ path: '/castingDetail?id=' + info.id }">
|
|
|
+ <div class="text">
|
|
|
+ <img class="text1" :src="info.avatar" alt="" />
|
|
|
+ <div class="box2">
|
|
|
+ <div class="name">
|
|
|
+ <div class="name1">{{ info.nickname }}</div>
|
|
|
+ <img class="name2" src="../assets/img/renzheng_icon@3x.png" alt="" />
|
|
|
+ </div>
|
|
|
+ <div class="text2">暂无</div>
|
|
|
+ <div class="box3">
|
|
|
+ <div class="box4">
|
|
|
+ <div class="text4">
|
|
|
+ 粉丝 <span>{{ info.follows }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="text4">
|
|
|
+ 已售 <span>{{ info.sales }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="follow" :class="{ followed: info.follow }" @click.prevent="like(info)">
|
|
|
+ {{ info.follow ? '已关注' : '关注' }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="imgBox">
|
|
|
+ <img class="imgBox1" :src="info.bg" alt="" />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </router-link>
|
|
|
</div>
|
|
|
- <img class="img2" :src="userInfo.avatar" alt="" />
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import { mapState } from 'vuex';
|
|
|
+import user from '../mixins/user';
|
|
|
export default {
|
|
|
+ mixins: [user],
|
|
|
+ props: {
|
|
|
+ info: {
|
|
|
+ type: Object,
|
|
|
+ default: () => {
|
|
|
+ return {};
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
data() {
|
|
|
- return {
|
|
|
- tabs: ['粉丝', '关注'],
|
|
|
- active: ''
|
|
|
- };
|
|
|
+ return {};
|
|
|
},
|
|
|
- methods: {
|
|
|
- tab(e) {
|
|
|
- this.active = e;
|
|
|
- if (e === '关注') {
|
|
|
- this.$router.push('/fans');
|
|
|
- this.$emit('init');
|
|
|
- this.$forceUpdate();
|
|
|
+ computed: {
|
|
|
+ empty() {
|
|
|
+ if (this.info.length > 0) {
|
|
|
+ return true;
|
|
|
} else {
|
|
|
- this.$router.push('/fans');
|
|
|
- this.$emit('init2');
|
|
|
- this.$forceUpdate();
|
|
|
+ return false;
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- computed: {
|
|
|
- ...mapState(['userInfo'])
|
|
|
- }
|
|
|
+ mounted() {
|
|
|
+ console.log(this.info);
|
|
|
+ },
|
|
|
+ methods: {}
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="less" scoped>
|
|
|
.container {
|
|
|
- .top {
|
|
|
- height: 146px;
|
|
|
- width: 100%;
|
|
|
- background: @prim;
|
|
|
+ .border {
|
|
|
+ height: 1px;
|
|
|
+ background: #494a4d;
|
|
|
+ border-radius: 1px;
|
|
|
+ margin: 17px 10px 20px;
|
|
|
}
|
|
|
- .top1 {
|
|
|
- display: flex;
|
|
|
- justify-content: center;
|
|
|
- position: relative;
|
|
|
- .title {
|
|
|
- text-align: center;
|
|
|
- cursor: pointer;
|
|
|
- .text3 {
|
|
|
- font-size: 22px;
|
|
|
- font-weight: normal;
|
|
|
- color: #ffffff;
|
|
|
- line-height: 24px;
|
|
|
- }
|
|
|
+ /deep/ .el-empty {
|
|
|
+ width: 100px;
|
|
|
+ height: 110px;
|
|
|
+ padding-top: 200px;
|
|
|
+ margin: 0 auto;
|
|
|
+ }
|
|
|
+ /deep/ .el-empty__description {
|
|
|
+ color: #ccc;
|
|
|
+ margin: 10px 0 0 2px;
|
|
|
+ }
|
|
|
+ .followed {
|
|
|
+ border-color: #939599;
|
|
|
+ color: #939599 !important;
|
|
|
+ }
|
|
|
+ .content {
|
|
|
+ padding: 0 16px;
|
|
|
+ .box {
|
|
|
+ .flex();
|
|
|
+ justify-content: space-between;
|
|
|
.text {
|
|
|
- display: flex;
|
|
|
- .text2 {
|
|
|
- font-size: 14px;
|
|
|
- font-weight: 400;
|
|
|
- padding: 0 100px;
|
|
|
- color: #939599;
|
|
|
- line-height: 24px;
|
|
|
- margin-top: 6px;
|
|
|
- &.active {
|
|
|
- color: @prim;
|
|
|
+ .flex();
|
|
|
+ justify-content: space-between;
|
|
|
+ .text1 {
|
|
|
+ width: 78px;
|
|
|
+ height: 78px;
|
|
|
+ border-radius: 50%;
|
|
|
+ background: red;
|
|
|
+ margin-right: 12px;
|
|
|
+ }
|
|
|
+ .box2 {
|
|
|
+ width: 288px;
|
|
|
+ margin-right: 50px;
|
|
|
+ .name {
|
|
|
+ .flex();
|
|
|
+ margin-top: 5px;
|
|
|
+ .name1 {
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #ffffff;
|
|
|
+ line-height: 24px;
|
|
|
+ margin-right: 6px;
|
|
|
+ }
|
|
|
+ .name2 {
|
|
|
+ width: 18px;
|
|
|
+ height: 18px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .text2 {
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #939599;
|
|
|
+ line-height: 24px;
|
|
|
+ margin-bottom: 8px;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ }
|
|
|
+ .box3 {
|
|
|
+ display: flex;
|
|
|
+ align-infos: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ .box4 {
|
|
|
+ display: flex;
|
|
|
+ .text4 {
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #939599;
|
|
|
+ line-height: 24px;
|
|
|
+ margin-right: 20px;
|
|
|
+ }
|
|
|
+ span {
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .follow {
|
|
|
+ width: 70px;
|
|
|
+ height: 26px;
|
|
|
+ color: @prim;
|
|
|
+ font-size: 14px;
|
|
|
+ border-radius: 16px;
|
|
|
+ border: 1px solid;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 26px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .imgBox {
|
|
|
+ .flex();
|
|
|
+ .imgBox1 {
|
|
|
+ width: 140px;
|
|
|
+ height: 100px;
|
|
|
+ border-radius: 8px;
|
|
|
+ margin-left: 30px;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- .img2 {
|
|
|
- position: absolute;
|
|
|
- width: 100px;
|
|
|
- height: 100px;
|
|
|
- border-radius: 50%;
|
|
|
- padding: 4px;
|
|
|
- background: #ffffff;
|
|
|
- top: -50px;
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
</style>
|