session.wxlogin().then(res => {
if (utils.isEmptyObj(res.user)) {
app.globalData.needReg = true
$this.showSplash()
} else {
try{
app.globalData.needReg = false
$this.show()
let id = e.currentTarget.id
let path = "";
if (id == 'chengzhong') {
path = '/pages/weight/weight'
} else if (id == 'dianshu') {
path = '/pages/count/count'
}
wx.switchTab({
url: path
})
}catch(e){
wx.showModal({
title: 'TODO',
content: 'TODO,TODO'+e
})
}
}
}).catch(e => {
console.log(e)
wx.showModal({
title: '164',
content: '164,e'+e.toString()
})
})
console.log('------------')
|