HBuilder 9.1.25.201810101806
微信:6.7.3
plus.oauth.getServices(function(services) {
alert(JSON.stringify(services));
if(services.length > 0) {
var weixin = null;
for(var i = 0; i < services.length; i++) {
if(services[i].id == 'weixin') {
weixin = services[i];
break;
}
}
if(weixin) {
/*此方法可以*/
weixin.login(function(e) {
alert(JSON.stringify(e));
}, function(e) {
alert(JSON.stringify(e));
alert("登录失败");
});
/*此方法本地真机调试可以,云打包不行*/
weixin.authorize(function(e) {
alert(JSON.stringify(e));
}, function(e) {
alert(JSON.stringify(e));
alert("登录失败");
}, {
scope: 'snsapi_userinfo',
state: 'authorize',
appid: 'xxx'
});
} else {
alert("请确认手机已安装微信客户端");
}
} else {
alert("services is null");
}
}, function(e) {
alert(e.message);
});
[已删除]
联系我帮你呼醒
2018-11-03 13:57
1***@qq.com
回复 [已删除]:我联系你妹妹哦
2018-11-03 14:09