提交 4c938552 编写于 作者: 芊里

查看阅读记录

上级 5523b730
......@@ -16,7 +16,8 @@ module.exports = {
"needLogin":[ //配置需要路由拦截的页面地址,在打开这些页面之前会自动检查(不联网)uni_id_token的值是否存在/过期等
"/pages/ucenter/edit/edit",
"/pages/ucenter/settings/settings",
"/uni_modules/uni-login-page/pages/index/pwd-retrieve"
"/uni_modules/uni-login-page/pages/index/pwd-retrieve",
"/uni_modules/uni-news-favorite/pages/uni-news-favorite/list"
],
"login":["univerify","smsCode","username","weixin","apple"] //默认就是短信验证码登陆
},
......
<template>
<view class="container">
<unicloud-db ref="udb" v-slot:default="{data, pagination, loading, hasMore, error}" collection="opendb-news-favorite">
<unicloud-db ref="udb" v-slot:default="{data, pagination, loading, hasMore, error}" :where="where" orderby="update_date desc" collection="opendb-news-favorite">
<view v-if="error">{{error.message}}</view>
<view v-else-if="data">
<uni-list>
......@@ -19,13 +19,14 @@
</template>
<script>
import { mapGetters } from 'vuex';
export default {
data() {
return {
loadMore: {
contentdown: '',
contentrefresh: '',
contentnomore: ''
contentnomore: '',
}
}
},
......@@ -39,26 +40,19 @@
onReachBottom() {
this.$refs.udb.loadMore()
},
computed:{
...mapGetters({
userInfo:'user/info'
}),
where(){
return `user_id == '${this.userInfo._id}'`
}
},
methods: {
handleItemClick(item) {
console.log(item);
uni.navigateTo({
url: '/pages/list/detail?id='+item.article_id+'&title='+(item.article_title || '')
})
},
fabClick() {
// 打开新增页面
uni.navigateTo({
url: './add',
events: {
// 监听新增数据成功后, 刷新当前页面数据
refreshData: () => {
this.$refs.udb.loadData({
clear: true
})
}
}
})
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册