Merge branch 'YOUFANGAPP1.1' of 192.168.0.27:dev0/youfang-app into YOUFANGAPP1.1

This commit is contained in:
尹吉欢
2018-03-30 16:29:58 +08:00
4 changed files with 72 additions and 39 deletions
+35 -4
View File
@@ -1,8 +1,39 @@
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,"登录");
}
}
$("#wxLogin").addEventListener('tap',function() {
console.log("微信");
authLogin('weixin');
})
function authLogin(type) {
console.log("hhhhhhhhhhhhhhhhhhh")
}