Authored by ityuany

.

<template>
<a v-if="isShow" class="publish-btn hover-opacity" :class="{'scroll-opacity': scrolling}" :href="toHomeHref || 'javascript:;'">
<a v-if="isShow"
class="back-btn hover-opacity"
:class="{'scroll-opacity': scrolling}"
:href="toHomeHref || 'javascript:;'">
</a>
</template>
... ... @@ -41,13 +44,13 @@ export default {
</script>
<style scoped>
.publish-btn {
width: 280px;
.back-btn {
width: 260px;
height: 80px;
position: absolute;
bottom: 140px;
left: calc(50% - 130px);
z-index: 1;
z-index: 999;
display: flex;
align-items: center;
transition: all 600ms ease-in-out;
... ...
... ... @@ -15,6 +15,7 @@ import {get} from 'lodash';
import Article from './components/article/article';
import {createNamespacedHelpers, mapState} from 'vuex';
import YAS from 'utils/yas-constants';
import ReplaceToHome from 'components/replace-to-home/replace-to-home';
const {mapState: articleMapState, mapActions} = createNamespacedHelpers('article');
export default {
... ... @@ -85,6 +86,7 @@ export default {
}
},
components: {
ReplaceToHome,
Article
}
};
... ...
... ... @@ -51,6 +51,7 @@
@on-close="onClose"
@on-comment="onActionComment"></Comment>
</YohoActionSheet>
<ReplaceToHome :scrolling="scrolling"></ReplaceToHome>
<MoreActionSheet transfer ref="moreAction" @on-follow="onFollow" @on-delete="onDelete"></MoreActionSheet>
</Layout>
</template>
... ... @@ -63,6 +64,7 @@ import ArticleActionSheet from '../detail/article-action-sheet';
import ArticleResource from './article-resource-item';
import MoreActionSheet from '../detail/more-action-sheet';
import {mapState, mapActions, createNamespacedHelpers} from 'vuex';
import ReplaceToHome from '../../../../components/replace-to-home/replace-to-home';
const {mapMutations} = createNamespacedHelpers('article');
export default {
... ... @@ -99,6 +101,7 @@ export default {
},
data() {
return {
scrolling: false,
articleId: 0,
commentId: 0,
articleIndex: -1,
... ... @@ -199,6 +202,11 @@ export default {
},
onScroll(params) {
this.scrollEvent(params);
this.scrolling = true;
this._scTimer && clearTimeout(this._scTimer);
this._scTimer = setTimeout(() => {
this.scrolling = false;
}, 200);
},
onDounceScroll({item, scrollTop, startIndex}) {
this.scrollTop = scrollTop;
... ... @@ -314,6 +322,7 @@ export default {
}
},
components: {
ReplaceToHome,
ArticleItem,
ArticleActionSheet,
MoreActionSheet,
... ...
... ... @@ -10,10 +10,6 @@
<div class="topic-list">
<TopicItem v-for="(item, index) in topicList" :key="index" :data="item"></TopicItem>
</div>
<div class="loading">
<p v-if="noMore" class="load-text">没有更多了</p>
<Loading v-else class="load-icon" :size="20"></Loading>
</div>
</Scroll>
<ReplaceToHome :scrolling="scrolling" ></ReplaceToHome>
</Layout>
... ...