From 60999a8d9449d496dc4800ca6e4475826cb3fc9f Mon Sep 17 00:00:00 2001 From: hubingliang Date: Fri, 30 Mar 2018 14:59:33 +0800 Subject: [PATCH] =?UTF-8?q?3=E6=96=B9=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fangija-zsyf/js/login/wxLogin.js | 39 +++++++++++++++++++++++++--- fangija-zsyf/views/user/codeSms.html | 10 +------ 2 files changed, 36 insertions(+), 13 deletions(-) diff --git a/fangija-zsyf/js/login/wxLogin.js b/fangija-zsyf/js/login/wxLogin.js index bcf9faa..1b144a1 100644 --- a/fangija-zsyf/js/login/wxLogin.js +++ b/fangija-zsyf/js/login/wxLogin.js @@ -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") } diff --git a/fangija-zsyf/views/user/codeSms.html b/fangija-zsyf/views/user/codeSms.html index 9427781..85e71d4 100644 --- a/fangija-zsyf/views/user/codeSms.html +++ b/fangija-zsyf/views/user/codeSms.html @@ -72,7 +72,7 @@ 第三方登录

- +

@@ -101,14 +101,6 @@ $.config = {router: false}