diff --git a/pages/mine/mine-index.vue b/pages/mine/mine-index.vue index dc14c93..60499c3 100644 --- a/pages/mine/mine-index.vue +++ b/pages/mine/mine-index.vue @@ -11,14 +11,16 @@ - + + + - 李林 + {{userInfo.nickName||''}} - 1000 + {{userInfo.tfansNum||'0'}} @@ -40,17 +42,17 @@ - 积分140 + 积分{{userInfo.pointsBalance||'0'}} 赚积分{{item.unicode}} - + - 报名140 + 报名{{userInfo.report||'0'}} 去提额{{item.unicode}} - + @@ -132,7 +134,12 @@ formatNumberWithUnits, calculateTimeDifference } from '@/utils/common.js' - + import { + getJSONData + } from '@/utils/auth.js' + import { + bloggerDetail + } from '@/api/member/member.js' export default { components: { tabBarVue, @@ -141,17 +148,31 @@ return { //当前用户类型 nowUserType: null, + userInfo: {} } }, onLoad() { nowUserType = getUserType() }, + mounted() { + if (null != getJSONData(constant.userInfo)) { + this.userInfo = getJSONData(constant.userInfo) + this.getBloggerDetail() + } + }, computed: { windowHeight() { return uni.getSystemInfoSync().windowHeight - 50 } }, methods: { + getBloggerDetail() { + bloggerDetail(this.userInfo.userId).then(res => { + this.userInfo.tfansNum = res.data.tfansNum.toString() + this.userInfo.pointsBalance = res.data.pointsBalance.toString() + this.userInfo.report = res.data.report.toString() + }) + }, /** * 切换用户身份 */