Authored by yyq

more

... ... @@ -2,8 +2,8 @@
<Layout class="article-detail">
<RecycleScrollReveal :size="10" ref="scroll" @scroll="onScroll" :offset="2000" :on-fetch="onFetch" :manual-init="true">
<template v-slot:eternalTop>
<ArticleDeatilLong v-if="article.sort == 2" ref="detailLong" :data="article" :scroll-top="scrollTop" :list-title="listTitle" :scroll-to="scrollTo"></ArticleDeatilLong>
<ArticleDeatilNote v-else :data="article" :scroll-top="scrollTop" :list-title="listTitle" :scroll-to="scrollTo"></ArticleDeatilNote>
<ArticleDeatilLong v-if="article.sort == 2" ref="detailLong" :data="article" :scroll-top="scrollTop" :list-title="listTitle" :scroll-to="scrollTo" @on-show-more="onShowMore"></ArticleDeatilLong>
<ArticleDeatilNote v-else :data="article" :scroll-top="scrollTop" :list-title="listTitle" :scroll-to="scrollTo" @on-show-more="onShowMore"></ArticleDeatilNote>
</template>
<template class="article-item" #item="{ data }">
<ArticleItem2
... ... @@ -20,6 +20,8 @@
</ArticleItem2>
</template>
</RecycleScrollReveal>
<MoreActionSheet transfer ref="moreAction" @on-follow="onFollow" @on-delete="onDelete"></MoreActionSheet>
</Layout>
</template>
... ... @@ -29,6 +31,7 @@ import {get} from 'lodash';
import ArticleDeatilLong from './components/detail/article-long';
import ArticleDeatilNote from './components/detail/article-note';
import ArticleItem2 from './components/article/article-item2';
import MoreActionSheet from './components/detail/more-action-sheet';
import {createNamespacedHelpers} from 'vuex';
const {mapState, mapActions} = createNamespacedHelpers('article');
... ... @@ -141,12 +144,18 @@ export default {
scrollTo({scrollTop}) {
this.$refs.scroll.$el.scrollTop = scrollTop;
this.scrollTop = scrollTop;
}
},
onShowMore() {
this.$refs.moreAction.show(this.article);
},
onFollow() {},
onDelete() {}
},
components: {
ArticleDeatilLong,
ArticleDeatilNote,
ArticleItem2
ArticleItem2,
MoreActionSheet
}
};
</script>
... ...
... ... @@ -3,7 +3,7 @@
<ArticleDetailHeader ref="header" :step="100" :title-step="100">
<div class="title-main">
<div class="title-info" :style="`transform: translate3d(0, ${titleTranslateY}, 0)`">
<ArticleItemHeader class="title-info-author" :share="share" :data="authorData" :lazy="lazy" :more="showMoreOpt" @on-follow="onFollow"></ArticleItemHeader>
<ArticleItemHeader class="title-info-author" :share="share" :data="authorData" :lazy="lazy" :more="false" @on-follow="onFollow"></ArticleItemHeader>
<div class="title-info-rec">{{listTitle}}</div>
</div>
</div>
... ... @@ -15,7 +15,12 @@
<ProductGroup :article-id="data.articleId" :pos-id="0" :index="0" :thumb="thumb" v-if="productListData.length" :share="share" :data="productListData" :lazy="lazy"></ProductGroup>
<ArticleDetailIntro :data="introData"></ArticleDetailIntro>
<ArticleItemTopics class="topics-wrap" :data="topicsData" :share="share"></ArticleItemTopics>
<div class="topics-wrap">
<ArticleItemTopics :data="topicsData" :share="share"></ArticleItemTopics>
<div class="more-wrap">
<i class="iconfont icon-more1" @click="onMore"></i>
</div>
</div>
<p class="publish-time">{{publishTime}}</p>
<ArticleDetailCommentList ref="commentList" v-if="data.commentCount" :article-id="data.articleId" :comment-count="data.commentCount"></ArticleDetailCommentList>
... ... @@ -76,7 +81,6 @@ export default {
},
data() {
return {
showMoreOpt: false,
slideIndex: 1,
commentList: [],
commentPage: 1,
... ... @@ -165,6 +169,9 @@ export default {
} else {
this.$refs.commentInput.$el.click();
}
},
onMore() {
this.$emit('on-show-more');
}
},
components: {
... ... @@ -212,6 +219,25 @@ export default {
}
}
.topics-wrap {
display: flex;
margin-top: 40px;
> * {
margin-top: 0;
}
.more-wrap {
padding-right: 30px;
display: flex;
align-items: center;
}
.iconfont {
font-size: 44px;
}
}
.publish-time {
display: block;
font-size: 24px;
... ...
... ... @@ -3,10 +3,12 @@
<div class="action-wrap">
<div class="action-list">
<div class="action-item" v-for="(i, index) in list" :key="index" v-show="!i.hide" @click="onClick(i.fnName)">
<p class="icon">
<span class="iconfont" :class="i.icon"></span>
</p>
<p class="name">{{i.name}}</p>
<a :href="i.href || 'javascript:;'">
<p class="icon">
<span class="iconfont" :class="i.icon"></span>
</p>
<p class="name">{{i.name}}</p>
</a>
</div>
</div>
<div class="cancel" @click="hide">取消</div>
... ... @@ -38,6 +40,10 @@ export default {
fnName: 'actionrReport'
},
{
icon: 'icon-edit',
name: '编辑'
},
{
icon: 'icon-delete',
name: '删除',
fnName: 'actionDelete'
... ... @@ -49,11 +55,15 @@ export default {
...articleStore.mapActions(['reportArticle', 'deleteArticle']),
...userStore.mapActions(['followUser']),
show(params, uid, index) {
this.index = index;
this.index = index || 0;
params = params || {};
const isAuthor = params.isAuthor !== 'Y';
this.list[0].hide = params.hasAttention !== 'Y';
this.list[2].hide = +params.authorUid !== uid || params.authorType !== 1;
this.list[2].href = `?openby:yohobuy={"action":"go.editPost","params":{"articleId":"${params.articleId}"}}`;
this.list[2].hide = isAuthor;
this.list[3].hide = isAuthor;
this.list = [...this.list];
this._params = params;
... ...