Authored by yyq

fix author home link

... ... @@ -8,4 +8,5 @@ var login = new Login({loginUrl: loginUrl, env: env});
export default {
goLogin: login.goLogin.bind(login),
getUser: Base.getUser.bind(Base)
};
... ...
... ... @@ -54,7 +54,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" :type="waterFallType"></WaterFall>
<WaterFall class="pannel-wrap" :list="list" :pos="scrollY" :link-tpl="linkTpl"></WaterFall>
</div>
<div v-if="loadStatus" class="loading">
... ... @@ -100,6 +100,17 @@
if (!this.$route.params.id) {
this._apiNamePre += 'Mine';
try {
this.$sdk.getUser().then(res => {
this.$route.params.id = res.uid;
this.autherInfo = assign({}, this.autherInfo, {
authorUid: res.uid
});
});
} catch(e){
console.log(e);
}
}
this.autherInfo = {
... ... @@ -164,6 +175,9 @@
list() {
return get(this.fetchInfo, `${this.activeIndex}.list`) || [];
},
linkTpl() {
return `/article/{articleId}?authorUid=${this.autherInfo.authorUid}&authorType=${this.autherInfo.authorType}&type=${['publish', 'fav'][this.activeIndex]}`;
},
waterFallType() {
return ['publish', 'fav'][this.activeIndex];
}
... ...
... ... @@ -70,10 +70,7 @@ export default {
type: Number,
default: 2
},
type: {
type: String,
default: 14
}
linkTpl: String
},
mounted() {
this.$on('calced', (nlist) => {
... ... @@ -280,7 +277,7 @@ export default {
}
},
link(item) {
return `/article/${item.articleId}?authorUid=${item.authorUid}&authorType=${item.authorType}&type=${this.type}`;
return (this.linkTpl || '').replace('{articleId}', item.articleId);
}
}
};
... ...