44 lines
1019 B
JavaScript
44 lines
1019 B
JavaScript
|
|
/**
|
|
* Web唐明明
|
|
* 一个梦想做木雕手艺人的程序员
|
|
* explain: userInfoLayer
|
|
*/
|
|
|
|
Component({
|
|
/**
|
|
* 组件的属性列表
|
|
*/
|
|
properties: {
|
|
showLayer: {
|
|
type : Boolean,
|
|
value : false
|
|
}
|
|
},
|
|
|
|
/**
|
|
* 组件的方法列表
|
|
*/
|
|
methods: {
|
|
userInfo(info){
|
|
if(info.detail.errMsg == "getUserInfo:ok"){
|
|
wx.$api.auth.authInfo({
|
|
nickname: info.detail.userInfo.nickName,
|
|
avatar : info.detail.userInfo.avatarUrl
|
|
}).then(()=>{
|
|
this.triggerEvent("updateinfo", true)
|
|
this.setData({
|
|
showLayer: false
|
|
})
|
|
})
|
|
}else{
|
|
wx.showToast({
|
|
title: '拒绝了授权',
|
|
icon : 'none'
|
|
})
|
|
this.triggerEvent("updateinfo", false)
|
|
}
|
|
}
|
|
}
|
|
})
|