From 8113388323e9839c075d966e74fc09c31efe42c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=8A=E9=87=8C?= <1227971437@qq.com> Date: Thu, 22 Apr 2021 17:11:33 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=AF=E5=88=86=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/ucenter/ucenter.vue | 13 +- .../pages/uni-news-favorite/list.vue | 126 +++++++++--------- 2 files changed, 72 insertions(+), 67 deletions(-) diff --git a/pages/ucenter/ucenter.vue b/pages/ucenter/ucenter.vue index 907f2cd..a073caf 100644 --- a/pages/ucenter/ucenter.vue +++ b/pages/ucenter/ucenter.vue @@ -181,10 +181,17 @@ uni.showLoading({ mask: true }) - db.collection(dbCollectionName).field('score,balance').get().then((res) => { - const data = res.result.data[0]; + db.collection(dbCollectionName).where('user_id == $env.uid').field('score,balance').get().then((res) => { + const data = res.result.data[0]; + console.log(data); + let msg = ''; + if(data){ + msg = '当前积分为' + data.balance + } else{ + msg = '当前无积分'; + } uni.showToast({ - title: '当前积分为' + data.balance, + title: msg, icon: 'none' }); }).catch((err) => { diff --git a/uni_modules/uni-news-favorite/pages/uni-news-favorite/list.vue b/uni_modules/uni-news-favorite/pages/uni-news-favorite/list.vue index ffae69a..66e8100 100644 --- a/uni_modules/uni-news-favorite/pages/uni-news-favorite/list.vue +++ b/uni_modules/uni-news-favorite/pages/uni-news-favorite/list.vue @@ -1,65 +1,63 @@ - - - - - -- GitLab