微信小程序如何获取用户的信息

微信小程序如何获取用户的信息

wxml:

<button open-type='getUserInfo'  bindgetuserinfo='userinfo'>点击获取</button>

js:

getUserInfo: function (e) {
    var that = this
    wx.login({
        success: function () {
            wx.getUserInfo({
                success: function (res) {
                    console.log('用户');
                    console.log(res);
                    console.log('信息');
                    // that.setData({
                    //   userInfo: res.userInfo
                    // });
                }, fail: function (ee) {
                    console.log(ee)
                    console.log('error');
                }
            })
        }, fail: function () {
        
        }
    })
},
微信小程序如何获取用户的信息

相关文章:

你感兴趣的文章:

标签云: