Files
AGuestSaas/components/loginLayer/loginLayer.js
2020-11-30 15:23:15 +08:00

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)
}
}
}
})