Skip to content
This repository has been archived by the owner on Nov 15, 2018. It is now read-only.

Commit

Permalink
fix(user): (#558) 游客模式不可在资讯列表选择资讯过滤器
Browse files Browse the repository at this point in the history
  • Loading branch information
mutoe committed Oct 16, 2018
1 parent 7973952 commit 1cca415
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
15 changes: 12 additions & 3 deletions src/page/news/NewsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
</template>
</common-header>

<news-filter @change="onCateChange"/>
<news-filter v-if="isLogin" @change="onCateChange"/>

<jo-load-more
ref="loadmore"
class="body"
:class="{guest: !isLogin}"
class="loadmore"
@onRefresh="onRefresh"
@onLoadMore="onLoadMore">

Expand Down Expand Up @@ -72,6 +73,10 @@ export default {
after() {
const len = this.newsList.length;
return len > 0 ? this.newsList[len - 1].id : 0;
},
isLogin() {
const user = this.$store.state.CURRENTUSER;
return Object.keys(user).length;
}
},
mounted() {
Expand Down Expand Up @@ -173,8 +178,12 @@ export default {
position: fixed;
}
.body {
.loadmore {
padding-top: 90+80px;
&.guest {
padding-top: 90px;
}
}
}
</style>
13 changes: 3 additions & 10 deletions src/page/news/components/NewsFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,20 @@
:class="`${prefixCls}--switch`"
@click="showEditor">
<svg>
<use
xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:href="#icon-arrow-right"/>
<use xlink:href="#icon-arrow-right"/>
</svg>
</div>
<span :class="`${prefixCls}--list__label`">我的订阅</span>
<div :class="[`${prefixCls}--list`, { editing }]">
<div
:class="[`${prefixCls}--list__item`, { active: ~~(currentCate.id) === 0 }]"
@click="chooseCate($event, {id: 0, name:'推荐'})"
>推荐</div>
<div :class="[`${prefixCls}--list__item`, { active: ~~(currentCate.id) === 0 }]" @click="chooseCate($event, {id: 0, name:'推荐'})" >推荐</div>
<div
v-for="myCate in myCates"
:class="[`${prefixCls}--list__item`, { active: myCate.id === currentCate.id }]"
:key="`myCate-${myCate.id}`"
@click="chooseCate($event, myCate)">{{ myCate.name }}</div>
</div>
</div>
<div
v-show="showAll"
:class="`${prefixCls}--list__wrap`">
<div v-show="showAll" :class="`${prefixCls}--list__wrap`">
<span :class="`${prefixCls}--list__label`">更多订阅</span>
<div :class="`${prefixCls}--list`">
<div
Expand Down

0 comments on commit 1cca415

Please sign in to comment.