...
|
...
|
@@ -24,27 +24,13 @@ |
|
|
</span>
|
|
|
<div class="author-section">
|
|
|
<ul class="author-fans">
|
|
|
<li>
|
|
|
<span class="num">{{baseData.attCount || 0}}</span>
|
|
|
<p class="name">
|
|
|
<span>关注</span>
|
|
|
</p>
|
|
|
</li>
|
|
|
<li>
|
|
|
<span class="num">{{baseData.fansCount || 0}}</span>
|
|
|
<p class="name">
|
|
|
<span>粉丝</span>
|
|
|
</p>
|
|
|
</li>
|
|
|
<li>
|
|
|
<span class="num">{{baseData.praiseAndfavorite || 0}}</span>
|
|
|
<p class="name">
|
|
|
<span>获赞与收藏</span>
|
|
|
</p>
|
|
|
<li v-for="(item, key) in fansList" :key="key">
|
|
|
<span class="num">{{baseData[key] || 0}}</span>
|
|
|
<p class="name"><span>{{item}}</span></p>
|
|
|
</li>
|
|
|
</ul>
|
|
|
<div class="operate-wrap">
|
|
|
<label v-if="isOwner" class="operate-btn btn-user-edit" @click="goUserInfoEdit">编辑个人资料</label>
|
|
|
<router-link v-if="isOwner" class="operate-btn btn-user-edit" to="//m.yohobuy.com/home/mydetails?openby:yohobuy={'action':'go.mineinfo'}">编辑个人资料</router-link>
|
|
|
<WidgetFollow v-else class="operate-btn" :author-uid="autherInfo.authorUid" :follow="isAttention" @on-follow="follow => onFollow(follow)"></WidgetFollow>
|
|
|
</div>
|
|
|
</div>
|
...
|
...
|
@@ -54,7 +40,7 @@ |
|
|
<FavTabBlock :tabs-num="tabsNum" :active-index="activeIndex" @change="changeTab"></FavTabBlock>
|
|
|
</cube-sticky-ele>
|
|
|
<div class="contant-list">
|
|
|
<WaterFall class="pannel-wrap" :list="list" :pos="scrollY" :link-tpl="linkTpl"></WaterFall>
|
|
|
<WaterFall class="pannel-wrap" :list="list" :pos="scrollY" :query="linkQueryString"></WaterFall>
|
|
|
</div>
|
|
|
|
|
|
<div v-if="loadStatus" class="loading">
|
...
|
...
|
@@ -86,6 +72,11 @@ |
|
|
autherInfo: {},
|
|
|
scrollEvents: ['scroll'],
|
|
|
scrollY: 0,
|
|
|
fansList: {
|
|
|
attCount: '关注',
|
|
|
fansCount: '粉丝',
|
|
|
praiseAndfavorite: '获赞与收藏'
|
|
|
},
|
|
|
baseData: {},
|
|
|
isAttention: false,
|
|
|
isOwner: false,
|
...
|
...
|
@@ -95,12 +86,10 @@ |
|
|
loadStatus: ''
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
this._apiNamePre = 'auther';
|
|
|
mounted() {
|
|
|
let $dom = this.$refs.headerAuthor;
|
|
|
|
|
|
if (!this.$route.params.id) {
|
|
|
this._apiNamePre += 'Mine';
|
|
|
|
|
|
try {
|
|
|
this.$sdk.getUser().then(res => {
|
|
|
if (get(res, 'uid') > 0) {
|
...
|
...
|
@@ -117,17 +106,6 @@ |
|
|
}
|
|
|
}
|
|
|
|
|
|
this.autherInfo = {
|
|
|
authorUid: this.$route.params.id,
|
|
|
authorType: this.$route.params.type || 1
|
|
|
};
|
|
|
|
|
|
this.fetchBaseInfo();
|
|
|
this.fetchList();
|
|
|
},
|
|
|
mounted() {
|
|
|
let $dom = this.$refs.headerAuthor;
|
|
|
|
|
|
if ($dom.offsetHeight) {
|
|
|
this._animeDuration = 300;
|
|
|
import('animejs').then(({default: anime}) => {
|
...
|
...
|
@@ -141,6 +119,19 @@ |
|
|
});
|
|
|
}
|
|
|
},
|
|
|
activated() {
|
|
|
console.log('activated');
|
|
|
if (this.$route.params.id !== this.autherInfo.authorUid) {
|
|
|
this.init(this.$route.params);
|
|
|
}
|
|
|
},
|
|
|
beforeRouteUpdate(to, from, next) {
|
|
|
console.log('beforeRouteUpdate');
|
|
|
if (this.$route.params.id !== to.params.labelId) {
|
|
|
this.init(to.params);
|
|
|
}
|
|
|
next();
|
|
|
},
|
|
|
watch: {
|
|
|
scrollY(top) {
|
|
|
let animePlayed = false;
|
...
|
...
|
@@ -179,6 +170,11 @@ |
|
|
list() {
|
|
|
return get(this.fetchInfo, `${this.activeIndex}.list`) || [];
|
|
|
},
|
|
|
linkQueryString() {
|
|
|
return assign({}, this.autherInfo, {
|
|
|
type: ['publish', 'fav'][this.activeIndex]
|
|
|
})
|
|
|
},
|
|
|
linkTpl() {
|
|
|
return `/grass/article/{articleId}?authorUid=${this.autherInfo.authorUid}&authorType=${this.autherInfo.authorType}&type=${['publish', 'fav'][this.activeIndex]}`;
|
|
|
},
|
...
|
...
|
@@ -188,6 +184,22 @@ |
|
|
},
|
|
|
methods: {
|
|
|
...mapActions(['autherBaseInfo', 'autherAritcleNum', 'autherPubList', 'autherFavList', 'autherMineBaseInfo', 'autherMineAritcleNum', 'autherMinePubList', 'autherMineFavList']),
|
|
|
init(params) {
|
|
|
params = params || {};
|
|
|
|
|
|
this._apiNamePre = 'auther';
|
|
|
if (!params.id) {
|
|
|
this._apiNamePre += 'Mine';
|
|
|
}
|
|
|
|
|
|
this.autherInfo = {
|
|
|
authorUid: params.id,
|
|
|
authorType: params.type || 1
|
|
|
};
|
|
|
|
|
|
this.fetchBaseInfo();
|
|
|
this.fetchList();
|
|
|
},
|
|
|
scrollHandler({ y }) {
|
|
|
this.scrollY = -y;
|
|
|
|
...
|
...
|
|