onGotUserInfo: function(e) {
console.log(e.detail.userInfo)
var that = this
that.setData({
hasUserInfo: true,
userInfo: e.detail.userInfo //把头像数据赋值给相应控件
})
that.update()
wx.request({
url: 'https://wxapp.aa.cn/1.php', //接口地址
data: {
nickname: "abcdefg",
avatar_url:"123456"
},
header: {
'content-type': 'application/json' //默认值
},
success: function (res) {
console.log(res.data);
}
})
}
1.检查要跳转的位置是否在app.js中注册过。
2.检查要跳转的地址是否有误。经常都是因为少写或者多写使得跳转无效。
3.检查要跳转的位置是否位于TabBar中,如果是的话,要使用wx.switchTab 来跳转界面(如果是在app.json中配置的tab)