Authored by yyq

share

... ... @@ -71,7 +71,7 @@ export default {
return this.$links.toDownloadApp();
}
if (this.data.commentCount) {
this.$emit('on-show-comment');
this.$emit('on-show-comment', {commentCount: this.data.commentCount});
}
},
getCommentContent(content = '') {
... ...
... ... @@ -96,6 +96,10 @@ export default {
this.reportClickAvatar();
},
toArticlePage() {
if (this.share) {
return this.$links.toDownloadApp();
}
this.$router.push({
name: 'article',
params: {
... ...
... ... @@ -5,8 +5,8 @@
<div v-if="showAttAmount" class="att-amount">
<label>{{data.attAmount}}人已关注</label>
</div>
<div v-if="+data.allowAttention" class="att-topic-btn" :class="attClass">
<WidgetFollow class="att-click-wrap" :topic-id="data.topicId" :follow="data.hasAttention" @on-follow="onFollow"></WidgetFollow>
<div v-if="+data.allowAttention" class="att-topic-btn" :class="attClass" @click="onClick">
<WidgetFollow v-if="!share" class="att-click-wrap" :topic-id="data.topicId" :follow="data.hasAttention" @on-follow="onFollow"></WidgetFollow>
<template v-if="data.hasAttention">
已关注
</template>
... ... @@ -21,7 +21,7 @@
<script>
export default {
props: ['data'],
props: ['data', 'share'],
computed: {
headStyle() {
if (!this.data.topicImageUrl) {
... ... @@ -42,6 +42,11 @@ export default {
}
},
methods: {
onClick() {
if (this.share) {
return this.$links.toDownloadApp();
}
},
onFollow(follow) {
this.$emit('on-follow', follow);
},
... ...
... ... @@ -6,12 +6,12 @@
<span :style="titleStyle">#{{title}}</span>
</div>
<div class="att-topic-btn" :class="attClass">
<WidgetFollow class="att-click-wrap" :topic-id="data.topicId" :follow="data.hasAttention" @on-follow="onFollow"></WidgetFollow>
<WidgetFollow v-if="!share" class="att-click-wrap" :topic-id="data.topicId" :follow="data.hasAttention" :share="share" @on-follow="onFollow"></WidgetFollow>
<span>{{data.hasAttention ? '已关注' : '关注'}}</span>
</div>
</template>
<template v-slot:opts>
<WidgetShare class="topic-share" :option="shareOption" @click.native="onShare"></WidgetShare>
<WidgetShare v-if="!share" class="topic-share" :option="shareOption" @click.native="onShare"></WidgetShare>
</template>
</LayoutHeader>
</div>
... ... @@ -31,7 +31,8 @@ export default {
props: [
'title',
'step',
'data'
'data',
'share'
],
computed: {
stepPercent() {
... ...
... ... @@ -39,6 +39,14 @@ export default [{
keepAlive: true
}
}, {
path: '/topic/share/:topicId/:topicName',
alias: '/topic/share/:topicId/:topicName',
name: 'topic.share',
component: () => import(/* webpackChunkName: "article" */ './topic'),
meta: {
keepAlive: true
}
}, {
path: '/article/:articleId/comment',
alias: '/article/:articleId/comment',
name: 'article.comment',
... ...
<template>
<div>
<Layout class="article">
<TopicHeader ref="header" :title="topicTitle" :step="headerAnimateStep" :data="topicInfo" @on-follow="onFollowTopic"></TopicHeader>
<TopicHeader ref="header" :title="topicTitle" :step="headerAnimateStep" :data="topicInfo" :share="share" @on-follow="onFollowTopic"></TopicHeader>
<RecycleScrollReveal v-if="topicInfo.viewModel == 2" :size="20" :thumbs="thumbs" ref="scroll" @scroll="onScroll" :offset="2000" :on-fetch="onFetch"
@on-inited="onInited">
<template v-slot:eternalTop>
<TopicBanner ref="topicHead" :data="topicInfo" @on-follow="onFollowTopic"></TopicBanner>
<TopicBanner ref="topicHead" :data="topicInfo" :share="share" @on-follow="onFollowTopic"></TopicBanner>
</template>
<template class="article-item" #item="{ data }">
<ArticleItem2
... ... @@ -27,7 +27,7 @@
<LayoutRecycleList v-if="topicInfo.viewModel == 1" :size="10" :thumbs="thumbs" ref="scroll" @scroll="onScroll" :offset="2000" :on-fetch="onFetch"
@on-inited="onInited">
<template class="article-item" #item="{ data }">
<TopicBanner v-if="data.data.topicHead" ref="topicHead" :data="topicInfo" @on-follow="onFollowTopic"></TopicBanner>
<TopicBanner v-if="data.data.topicHead" ref="topicHead" :data="topicInfo" :share="share" @on-follow="onFollowTopic"></TopicBanner>
<ArticleItem
v-else
type="topic"
... ... @@ -50,7 +50,7 @@
</template>
</LayoutRecycleList>
<a v-if="publishUrl" class="publish-btn hover-opacity" :class="{'scroll-opacity': scrolling}" :href="publishUrl">
<a v-if="publishUrl && !share" class="publish-btn hover-opacity" :class="{'scroll-opacity': scrolling}" :href="publishUrl">
<span class="avatar-block">
<WidgetAvatar class="avatar" :src="userHeadIco" :width="70" :height="70"></WidgetAvatar>
</span>
... ... @@ -112,6 +112,10 @@ export default {
next();
},
mounted() {
if (this.$route.name === 'topic.share') {
this.share = true;
}
if (this.$cookie && this.$cookie.get) {
this.userHeadIco = this.$cookie.get('_head_ico');
}
... ...