Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yoho-community-web
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
1
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
yyq
6 years ago
Commit
64d6759ac590e02d6e63a2c73e00216da2688be1
1 parent
413365f3
fix user detail
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
6 deletions
apps/pages/article/components/article/article.vue
apps/pages/userpage/components/author.vue
apps/pages/article/components/article/article.vue
View file @
64d6759
...
...
@@ -173,6 +173,12 @@ export default {
},
onDounceScroll({item, scrollTop, startIndex}) {
this.scrollTop = scrollTop;
// user 详情页禁止头部交互
if (this.type === 'userArticle') {
return;
}
if (scrollTop <= 0) {
this.showHeader = false;
} else if (item) {
...
...
apps/pages/userpage/components/author.vue
View file @
64d6759
...
...
@@ -5,15 +5,14 @@
<div class="h-name flex">
<span class="h-name-b">{{authorBaseData.nickName}}</span>
<span v-if="authorBaseData.sex" class="iconfont icon-women author-sex-icon" :class="`icon-${authorBaseData.sex}`"></span>
<div v-if="!isOwner" class="h-follow flex">
<WidgetFollow class="widget-follow" :class="{invisible: !tabFixed}" :author-uid="authorInfo.authorUid" :author-type="authorInfo.authorType" :follow="authorBaseData.isAttention" @on-follow="follow => onFollow(follow)" :pos-id="sceneId"></WidgetFollow>
</div>
</div>
<div class="h-more">
<div class="flex">
<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="authorInfo.authorUid" :author-type="authorInfo.authorType" :follow="authorBaseData.isAttention" @on-follow="follow => onFollow(follow)" :pos-id="sceneId"></WidgetFollow>
</div>
</div>
</div>
</LayoutHeader>
...
...
@@ -113,6 +112,21 @@ export default {
this.init(this.$route.params);
this.listMinHeight = this.$el.offsetHeight - this.$refs.tabBlock.offsetHeight - $dom.offsetHeight;
if ($dom.offsetHeight) {
this._animeDuration = 300;
import('animejs').then(({default: anime}) => {
this._animeEl = anime({
targets: $dom,
translateY: -$dom.offsetHeight,
easing: 'easeInOutSine',
duration: this._animeDuration,
autoplay: false
});
});
}
this.beforeRouteEnter = this.beforeRouteUpdate;
},
computed: {
list() {
...
...
@@ -126,12 +140,15 @@ export default {
authorUid: this.authorInfo.authorUid,
},
query: {
userName:
this.authorBaseData.nickName
userName:
`${this.isOwner ? '我' : this.authorBaseData.nickName}的${this.waterFallTypeName}`
}
};
},
waterFallType() {
return ['publish', 'fav'][this.activeIndex];
},
waterFallTypeName() {
return ['内容', '收藏'][this.activeIndex];
}
},
methods: {
...
...
@@ -154,6 +171,10 @@ export default {
this.emptyTip = '';
if (this.scrollY > 0) {
if (this._animeEl) {
this._animePlayed = false;
this._animeEl.seek(0);
}
this.$refs.scroll.scrollTo(0, 0);
}
...
...
@@ -197,6 +218,25 @@ export default {
this.tabFixed = animePlayed;
let start;
let self = this;
function step(timestamp) {
if (!start) {
start = timestamp
};
let progress = Math.floor(timestamp - start);
self._animeEl.seek(animePlayed ? progress : self._animeDuration - progress);
if (progress < self._animeDuration) {
window.requestAnimationFrame(step);
}
};
window.requestAnimationFrame(step);
this._animePlayed = animePlayed;
},
onScrollEndHandle(scroll) {
...
...
@@ -395,7 +435,7 @@ export default {
font-weight: 500;
.h-name-b {
max-width:
6
0%;
max-width:
8
0%;
line-height: 1.4;
overflow: hidden;
text-overflow: ellipsis;
...
...
Please
register
or
login
to post a comment