Files
youfang-app/fangija-zsyf/js/login/wxLogin.js
T
hubingliang 60999a8d94 3方登录
2018-03-30 14:59:33 +08:00

40 lines
960 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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")
}