根据文档http://www.html5plus.org/doc/zh_cn/oauth.html进行操作
代码如下:
document.addEventListener("plusready", function() {
// 扩展API加载完毕,现在可以正常调用扩展API
plus.oauth.getServices(function(services) {
auths = services;
console.log(JSON.stringify(services))
aweixin =services['weixin'];
}, function(e) {
alert("获取分享服务列表失败:" + e.message + " - " + e.code);
});
}, false);
真机运行调试信息:
[{"id":"weixin","description":"微信","authResult":null,"userInfo":null},{"id":"qq","description":"QQ","authResult":null,"userInfo":null},{"id":"sinaweibo","description":"新浪微博","authResult":null,"userInfo":null}]
配置如下图:
hbuilderx 信息: