From 5b020dbcffb67048eaf627925be3d974e398feef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B9=E5=90=89=E6=AC=A2?= Date: Mon, 9 Apr 2018 13:39:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=89=E9=92=AE=E5=8A=A0loding=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fangija-zsyf/js/login/codeSms.js | 45 ++++++++++++---------- fangija-zsyf/views/user/bindingMobile.html | 3 ++ fangija-zsyf/views/user/passLogin.html | 3 ++ fangija-zsyf/views/user/updatePass.html | 3 ++ 4 files changed, 34 insertions(+), 20 deletions(-) diff --git a/fangija-zsyf/js/login/codeSms.js b/fangija-zsyf/js/login/codeSms.js index 596a7df..c02fb57 100644 --- a/fangija-zsyf/js/login/codeSms.js +++ b/fangija-zsyf/js/login/codeSms.js @@ -70,28 +70,33 @@ $("#login_btn").on("click", function () { $.toast("请同意服务协议"); return false; } + plus.nativeUI.showWaiting(); axios.post("/rest/user/smsLogin", {mobile: phoneNum,smsCode:code,province:province,city:city,region:region,pushClientId:getPushInfo(),deviceId:plus.device.uuid} ).then(function (response) { - var resData = response.data; - if (resData.status) { - // 用户登录成功的TOKEN - var data = resData.data; - localStorage.setItem("user_token", data.token); - localStorage.setItem("user_token_add_time", new Date().getTime()); - $.toast(resData.message); - if (data.firstLogin) { - // 显示设置密码页面 - clicked('../user/updatePass.html',true,false,{},{},function(){ - back(); - }) - } else { - back(); - } - - } else { - $.toast(resData.message); - } - }) + var resData = response.data; + if (resData.status) { + // 用户登录成功的TOKEN + var data = resData.data; + localStorage.setItem("user_token", data.token); + localStorage.setItem("user_token_add_time", new Date().getTime()); + $.toast(resData.message); + if (data.firstLogin) { + // 显示设置密码页面 + clicked('../user/updatePass.html',true,false,{},{},function(){ + back(); + }) + } else { + back(); + } + + } else { + $.toast(resData.message); + } + plus.nativeUI.closeWaiting(); + }).catch(function (error) { + $.toast(error); + plus.nativeUI.closeWaiting(); + }); } }); diff --git a/fangija-zsyf/views/user/bindingMobile.html b/fangija-zsyf/views/user/bindingMobile.html index 7698f1b..6c112ab 100644 --- a/fangija-zsyf/views/user/bindingMobile.html +++ b/fangija-zsyf/views/user/bindingMobile.html @@ -176,6 +176,7 @@ var vue = new Vue({ // 绑定手机 binding: function() { if (this.checkMobile() && this.checkSmsCode()) { + plus.nativeUI.showWaiting(); axios.post("/rest/user/bindMobile", { mobile:this.mobile, smsCode:this.smsCode, @@ -201,9 +202,11 @@ var vue = new Vue({ } else { $.toast(resData.message); } + plus.nativeUI.closeWaiting(); }) .catch(function (error) { $.toast(error); + plus.nativeUI.closeWaiting(); }); } } diff --git a/fangija-zsyf/views/user/passLogin.html b/fangija-zsyf/views/user/passLogin.html index bf9bb1c..1f3f3a4 100644 --- a/fangija-zsyf/views/user/passLogin.html +++ b/fangija-zsyf/views/user/passLogin.html @@ -124,6 +124,7 @@ new Vue({ $.toast("请输入密码"); return; } + plus.nativeUI.showWaiting(); axios.post("/rest/user/passLogin", {mobile:this.mobile, pass: $.md5(this.pass), pushClientId:getPushInfo()}) .then(function (response) { var resData = response.data; @@ -137,9 +138,11 @@ new Vue({ } else { $.toast(resData.message); } + plus.nativeUI.closeWaiting(); }) .catch(function (error) { $.toast(error); + plus.nativeUI.closeWaiting(); }); } }, diff --git a/fangija-zsyf/views/user/updatePass.html b/fangija-zsyf/views/user/updatePass.html index ed87ad8..c3c8256 100644 --- a/fangija-zsyf/views/user/updatePass.html +++ b/fangija-zsyf/views/user/updatePass.html @@ -115,6 +115,7 @@ new Vue({ $.toast("请输入6位以上数字或字母"); return; } + plus.nativeUI.showWaiting(); axios.post("/rest/user/upass", {newPass: $.md5(this.pass)}) .then(function (response) { var resData = response.data; @@ -124,9 +125,11 @@ new Vue({ } else { $.toast(resData.message); } + plus.nativeUI.closeWaiting(); }) .catch(function (error) { $.toast(error); + plus.nativeUI.closeWaiting(); }); }, /* 密码显示&隐藏 */