40 lines
960 B
JavaScript
40 lines
960 B
JavaScript
var auths = {}
|
||
function plusReady() {
|
||
plus.oauth.getServices(function(services) {
|
||
alert("111111111111111111111111")
|
||
auths = services;
|
||
}, function(e) {
|
||
alert("获取登录服务列表失败:" + e.message + " - " + e.code);
|
||
});
|
||
}
|
||
document.addEventListener('plusready',plusReady,false);
|
||
// 登录认证
|
||
function webChatLogin(){
|
||
var auth=auths['weixin'];
|
||
if(auth){
|
||
var w=null;
|
||
if(plus.os.name=="Android"){
|
||
w=plus.nativeUI.showWaiting();
|
||
}
|
||
document.addEventListener("pause",function(){
|
||
setTimeout(function(){
|
||
w&&w.close();w=null;
|
||
},2000);
|
||
}, false );
|
||
auth.login(function(){
|
||
w&&w.close();w=null;
|
||
userinfo(auth);
|
||
},function(e){
|
||
w&&w.close();w=null;
|
||
$.toast("登录认证失败:["+e.code+"]:"+e.message);
|
||
});
|
||
}else{
|
||
$.toast("无效的登录认证通道!");
|
||
$.toast("无效的登录认证通道!",null,"登录");
|
||
}
|
||
}
|
||
|
||
function authLogin(type) {
|
||
console.log("hhhhhhhhhhhhhhhhhhh")
|
||
}
|