25 lines
412 B
JavaScript
25 lines
412 B
JavaScript
|
|
const app = getApp()
|
||
|
|
|
||
|
|
Page({
|
||
|
|
data: {
|
||
|
|
name: '',
|
||
|
|
days: 0,
|
||
|
|
badges: 0,
|
||
|
|
},
|
||
|
|
onLoad() {
|
||
|
|
const { userInfo } = app.globalData
|
||
|
|
this.setData({
|
||
|
|
name: userInfo.name,
|
||
|
|
days: userInfo.days,
|
||
|
|
badges: userInfo.badges,
|
||
|
|
})
|
||
|
|
},
|
||
|
|
goTo(e) {
|
||
|
|
const { url } = e.currentTarget.dataset
|
||
|
|
wx.navigateTo({ url })
|
||
|
|
},
|
||
|
|
goHome() {
|
||
|
|
wx.switchTab({ url: '/pages/index/index' })
|
||
|
|
},
|
||
|
|
})
|