silu/创旅丝路/resources/wechatapp-master/pages/tree/tree.js

32 lines
623 B
JavaScript
Raw Permalink Normal View History

2025-10-14 00:45:23 +08:00
//js
Page(
{
data: {
canIUse: wx.canIUse('button.open-type.getUserInfo')
},
onLoad: function () {
// 查看是否授权
wx.getSetting({
success: function (res) {
if (res.authSetting['scope.userInfo']) {
// 已经授权,可以直接调用 getUserInfo 获取头像昵称
wx.getUserInfo({
success: function (res) {
console(res.userInfo)
}
})
}
}
})
},
bindGetUserInfo: function (e) {
console.log(e.detail.userInfo)
},
gogo: function(){
wx.navigateTo({
url: 'gog'
})
}
})