onShareAppMessage: function( e ){
console.log('分享')
wx.getSetting({
success (rest){
if (rest.authSetting['scope.userInfo']) {
// 已经授权,可以直接调用 getUserInfo 获取头像昵称
wx.getUserInfo({
success: function(re) {
app.globalData.sex = re.userInfo.gender
app.wechatRoca().then(res => {
that.getUser(re.userInfo.avatarUrl,re.userInfo.gender)
})
}
})
}
}
})
var path = '/pages/details/details‘;
var tup = '../img/bg98.png';
var shareObj = {
title: '求帮助',
path:path,
imageUrl:tup,
}
return shareObj;
}
- 当前 Bug 的表现(可附上截图)
没有出现授权页面
- 预期表现
先用户授权,不管确认还是取消,进行分享页面