diff --git a/fangija-zsyf/css/main.css b/fangija-zsyf/css/main.css index 1b238fe..25a7c2e 100644 --- a/fangija-zsyf/css/main.css +++ b/fangija-zsyf/css/main.css @@ -175,32 +175,7 @@ em.down{color:#88D053;} .bar-tab:before{background-color:#DCDCDC;transform:scaleY(1);} .bar-tab .tab-item .icon ~ .tab-label{top:0.05rem;} -/* 登录 */ -.icon-login01{width:14px;height:20px;background:url(../images/icon-login01.png) no-repeat center center;background-size:100%;vertical-align:text-bottom;} -.icon-login02{width:15px;height:19px;background:url(../images/icon-login02.png) no-repeat center center;background-size:100%;vertical-align:text-bottom;} -.icon-login03{width:15px;height:18px;background:url(../images/icon-login03.png) no-repeat center center;background-size:100%;vertical-align:text-bottom;} -.icon-loginMode01{width:30px;height:24px;background:url(../images/icon-loginMode01.png) no-repeat center center;background-size:100%;} -.icon-loginMode02{width:30px;height:24px;background:url(../images/icon-loginMode02.png) no-repeat center center;background-size:100%;} -.icon-loginMode03{width:22px;height:24px;background:url(../images/icon-loginMode03.png) no-repeat center center;background-size:100%;} -#input_phoneNumber,#input_codeSms,#input_password{left:24px;width:80%;} -#input_phoneNumber{width:50%;} -#input_feedback{width:100%;height:100px;} -.list-block .item-after .icon-eye-grey{width:0.9rem;height:0.65rem;margin-right:0;margin-top:0.25rem;} -.list-block .item-after .icon-eye-orange{width:0.9rem;height:0.65rem;margin-right:0;margin-top:0.25rem;} -.sendCode{padding:0 8px;height:27px;background:#fff;border:solid 1px #2db0fc;border-radius:3px;color:#2db0fc;text-align:center;line-height:26px;font-size:0.7rem;float:right;margin-top:-2px;} -.waiting{padding:0 8px;height:27px;background:#0a8ddf;border:solid 1px #0a8ddf;border-radius:3px;color:#fff;text-align:center;line-height:26px;font-size:0.7rem;float:right;margin-top:-2px;} -.agreement{font-size:0.65rem;color:#666;margin-left:0.75rem;} -.agreement a{font-size:0.65rem;} -.check{width:18px;height:18px;border:solid 1px #D7D7D7;border-radius:0.05rem;display:inline-block;vertical-align:middle;margin-right:0.2rem;position:relative;} -.checkImg{width:10px;height:7px;position:absolute;top:5px;left:3px;} -.loginBox p{text-align:center;margin:0;} -.loginBox p .button{margin-top:2rem;margin-bottom:0.5rem;} -.loginBox p a{font-size:0.65rem;color:#AA907A;} -.loginMode{width:100%;position:absolute;bottom:4.5rem;} -.loginMode p{font-size:0.65rem;color:#999;text-align:center;} -.loginMode p a:nth-child(2){margin:0 2rem;} -.line{width:100%;height:1px;background:#e5e5e5;margin-bottom:1.5rem;position:relative;} -.line span{position:absolute;top:-10px;left:50%;margin-left:-57.5px;display:block;background:#fff;padding:0 25px;font-size:0.65rem;color:#999;} + /* 首页 */ .totalValue{padding:1rem 0;overflow:hidden;} .totalValue div:first-child{float:left;margin-left:0.75rem;} diff --git a/fangija-zsyf/js/axiosPlugin.js b/fangija-zsyf/js/axiosPlugin.js index bfa7c47..8bfca8b 100644 --- a/fangija-zsyf/js/axiosPlugin.js +++ b/fangija-zsyf/js/axiosPlugin.js @@ -3,7 +3,8 @@ axios.defaults.headers.post['Content-Type'] = 'application/json'; // 添加请求拦截器 axios.interceptors.request.use(function (config) { - config.headers.Authorization = '111111111' + var token = localStorage.getItem("user_token"); + config.headers.Authorization = token return config; }, function (error) { return Promise.reject(error); diff --git a/fangija-zsyf/js/login/codeSms.js b/fangija-zsyf/js/login/codeSms.js index 3258408..b994a94 100644 --- a/fangija-zsyf/js/login/codeSms.js +++ b/fangija-zsyf/js/login/codeSms.js @@ -61,20 +61,26 @@ $("#login_btn").on("click", function () { var phoneNum = $("#input_phoneNumber").val(); var code = $("#input_codeSms").val(); var protocal = $(".check").find(".checkImg").css("display"); - if(phoneNum == ""){ - $.toast("请输入手机号码"); - return false; - } - if(code == ""){ - $.toast("请输入验证码"); - return false; - } - if(protocal != "block"){ - $.toast("请同意服务协议"); - return false; - } - axios.post("/rest/user/sendMobileCode", {mobile: mobile}) - .then(function (response) { - - }) + if(checkPhoneNum(phoneNum)){ + if(code == ""){ + $.toast("请输入验证码"); + return false; + } + if(protocal != "block"){ + $.toast("请同意服务协议"); + return false; + } + axios.post("/rest/user/smsLogin", {mobile: phoneNum,smsCode:code}) + .then(function (response) { + var resData = response.data; + if (resData.status) { + // 用户登录成功的TOKEN + var token = resData.data; + localStorage.setItem("user_token", token); + $.toast(resData.message); + } else { + $.toast(resData.message); + } + }) + } }); diff --git a/fangija-zsyf/js/login/wxLogin.js b/fangija-zsyf/js/login/wxLogin.js new file mode 100644 index 0000000..1b144a1 --- /dev/null +++ b/fangija-zsyf/js/login/wxLogin.js @@ -0,0 +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,"登录"); + } +} + +function authLogin(type) { + console.log("hhhhhhhhhhhhhhhhhhh") +} diff --git a/fangija-zsyf/views/user/codeSms.html b/fangija-zsyf/views/user/codeSms.html index 8815ac2..dd132a4 100644 --- a/fangija-zsyf/views/user/codeSms.html +++ b/fangija-zsyf/views/user/codeSms.html @@ -9,7 +9,7 @@ - + @@ -20,7 +20,7 @@