diff --git a/pages/ucenter/ucenter.vue b/pages/ucenter/ucenter.vue index 907f2cd227388fd6024d2a56e38710aa061b55a5..a073caf821ce26d025f787ad2fb5cf4c27157dac 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 ffae69ae473b7b2019d950d455b96a44ee6ee406..66e810041accb4bd014a314c4be7ad34fc361750 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 @@ - - - - -