...
|
...
|
@@ -11,7 +11,7 @@ |
|
|
<WidgetAvatar class="h-headico" :src="authorBaseData.headIco" :width="100" :height="100"></WidgetAvatar>
|
|
|
</div>
|
|
|
<div v-if="!isOwner" class="h-follow flex">
|
|
|
<WidgetFollow class="widget-follow" :author-uid="autherInfo.authorUid" :follow="authorBaseData.isAttention" @on-follow="follow => onFollow(follow)" :pos-id="sceneId"></WidgetFollow>
|
|
|
<WidgetFollow class="widget-follow" :author-uid="authorInfo.authorUid" :author-type="authorInfo.authorType" :follow="authorBaseData.isAttention" @on-follow="follow => onFollow(follow)" :pos-id="sceneId"></WidgetFollow>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
...
|
...
|
@@ -35,14 +35,15 @@ |
|
|
</span>
|
|
|
<div class="author-section">
|
|
|
<ul class="author-fans">
|
|
|
<li v-for="(item, key) in fansList" :key="key">
|
|
|
<span class="num">{{authorBaseData[key] || 0}}</span>
|
|
|
<p class="name"><span>{{item}}</span></p>
|
|
|
<li v-for="item in fansList" :key="item.key">
|
|
|
<div class="click-wrap" @click="toPage(item.type)"></div>
|
|
|
<span class="num">{{authorBaseData[item.key] || 0}}</span>
|
|
|
<p class="name"><span>{{item.name}}</span></p>
|
|
|
</li>
|
|
|
</ul>
|
|
|
<div class="operate-wrap">
|
|
|
<a v-if="isOwner" class="operate-btn btn-user-edit" :href="mineInfoUrl">编辑个人资料</a>
|
|
|
<WidgetFollow v-if="!isOwner" class="operate-btn" :author-uid="autherInfo.authorUid" :follow="authorBaseData.isAttention" @on-follow="follow => onFollow(follow)" :pos-id="sceneId"></WidgetFollow>
|
|
|
<WidgetFollow v-if="!isOwner" class="operate-btn" :author-uid="authorInfo.authorUid" :author-type="authorInfo.authorType" :follow="authorBaseData.isAttention" @on-follow="follow => onFollow(follow)" :pos-id="sceneId"></WidgetFollow>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
...
|
...
|
@@ -82,12 +83,12 @@ export default { |
|
|
scrolling: false,
|
|
|
mineInfoUrl: '//m.yohobuy.com/home/mydetails?openby:yohobuy={"action":"go.mineinfo"}',
|
|
|
publishUrl: '?openby:yohobuy={"action":"go.grasspublish"}',
|
|
|
autherInfo: {},
|
|
|
fansList: {
|
|
|
attCount: '关注',
|
|
|
fansCount: '粉丝',
|
|
|
praiseAndfavorite: '获赞与收藏'
|
|
|
},
|
|
|
authorInfo: {},
|
|
|
fansList: [
|
|
|
{name: '关注', key: 'attCount', type: 'follow'},
|
|
|
{name: '粉丝', key: 'fansCount', type: 'fans'},
|
|
|
{name: '获赞与收藏', key: 'praiseAndfavorite'}
|
|
|
],
|
|
|
tabFixed: false,
|
|
|
tabsNum: [0, 0],
|
|
|
activeIndex: 0,
|
...
|
...
|
@@ -125,7 +126,7 @@ export default { |
|
|
}
|
|
|
},
|
|
|
activated() {
|
|
|
if (this.$route.params.id && +this.$route.params.id !== this.autherInfo.authorUid) {
|
|
|
if (this.$route.params.id && +this.$route.params.id !== this.authorInfo.authorUid) {
|
|
|
this.init(this.$route.params);
|
|
|
}
|
|
|
},
|
...
|
...
|
@@ -144,8 +145,8 @@ export default { |
|
|
return {
|
|
|
params: {
|
|
|
type: this.waterFallType,
|
|
|
authorType: this.autherInfo.authorType,
|
|
|
authorUid: this.autherInfo.authorUid,
|
|
|
authorType: this.authorInfo.authorType,
|
|
|
authorUid: this.authorInfo.authorUid,
|
|
|
},
|
|
|
query: {
|
|
|
userName: this.authorBaseData.nickName
|
...
|
...
|
@@ -158,11 +159,11 @@ export default { |
|
|
},
|
|
|
methods: {
|
|
|
...mapMutations(['CHANGE_AUTHOR_OWNER_STATUS', 'CHANGE_AUTHOR_ATTENTION_STATUS']),
|
|
|
...mapActions(['autherBaseInfo', 'autherAritcleNum', 'autherPubList', 'autherFavList', 'autherMineBaseInfo', 'autherMineAritcleNum', 'autherMinePubList', 'autherMineFavList']),
|
|
|
...mapActions(['authorBaseInfo', 'authorAritcleNum', 'authorPubList', 'authorFavList', 'authorMineBaseInfo', 'authorMineAritcleNum', 'authorMinePubList', 'authorMineFavList']),
|
|
|
init(params) {
|
|
|
params = params || {};
|
|
|
|
|
|
this._apiNamePre = 'auther';
|
|
|
this._apiNamePre = 'author';
|
|
|
|
|
|
this.CHANGE_AUTHOR_OWNER_STATUS(!this.$route.params.id);
|
|
|
this.tabFixed = false;
|
...
|
...
|
@@ -191,7 +192,7 @@ export default { |
|
|
}
|
|
|
},
|
|
|
fetchData(authorUid, authorType, noBase) {
|
|
|
this.autherInfo = {authorUid, authorType};
|
|
|
this.authorInfo = {authorUid, authorType};
|
|
|
|
|
|
this.fetchBaseInfo();
|
|
|
this.fetchList(true);
|
...
|
...
|
@@ -276,9 +277,9 @@ export default { |
|
|
}
|
|
|
},
|
|
|
fetchBaseInfo() {
|
|
|
this[this._apiNamePre + 'BaseInfo'](this.autherInfo);
|
|
|
this[this._apiNamePre + 'BaseInfo'](this.authorInfo);
|
|
|
|
|
|
this[this._apiNamePre + 'AritcleNum'](this.autherInfo).then(res => {
|
|
|
this[this._apiNamePre + 'AritcleNum'](this.authorInfo).then(res => {
|
|
|
this.tabsNum = [get(res, 'data.articleCount'), get(res, 'data.favoriteCount')];
|
|
|
});
|
|
|
},
|
...
|
...
|
@@ -315,7 +316,7 @@ export default { |
|
|
limit: 20,
|
|
|
page: info.page,
|
|
|
lastedTime: info.lastedTime || ''
|
|
|
}, this.autherInfo));
|
|
|
}, this.authorInfo));
|
|
|
|
|
|
this.syncing = false;
|
|
|
}
|
...
|
...
|
@@ -369,6 +370,24 @@ export default { |
|
|
},
|
|
|
onFollow(follow) {
|
|
|
this.CHANGE_AUTHOR_ATTENTION_STATUS(follow);
|
|
|
},
|
|
|
toPage(type) {
|
|
|
let routerName = '';
|
|
|
let params = {};
|
|
|
|
|
|
if (type) {
|
|
|
routerName = `${this.isOwner ? 'mine' : 'author'}.${type}`;
|
|
|
|
|
|
if (!this.isOwner) {
|
|
|
params.id = this.authorInfo.authorUid;
|
|
|
params.type = this.authorInfo.authorType;
|
|
|
}
|
|
|
|
|
|
this.$router.push({
|
|
|
name: routerName,
|
|
|
params
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
components: {
|
...
|
...
|
@@ -501,11 +520,21 @@ export default { |
|
|
li {
|
|
|
margin-left: 140px;
|
|
|
position: relative;
|
|
|
z-index: 1;
|
|
|
|
|
|
&:first-child {
|
|
|
margin-left: 0;
|
|
|
}
|
|
|
|
|
|
.click-wrap {
|
|
|
position: absolute;
|
|
|
left: -50px;
|
|
|
right: -50px;
|
|
|
top: -14px;
|
|
|
bottom: -50px;
|
|
|
z-index: 10;
|
|
|
}
|
|
|
|
|
|
.num {
|
|
|
min-width: 30px;
|
|
|
font-size: 28px;
|
...
|
...
|
|