按钮加loding框

This commit is contained in:
尹吉欢
2018-04-09 13:39:07 +08:00
parent 6d6b6a2047
commit 5b020dbcff
4 changed files with 34 additions and 20 deletions
+6 -1
View File
@@ -70,6 +70,7 @@ $("#login_btn").on("click", function () {
$.toast("请同意服务协议"); $.toast("请同意服务协议");
return false; return false;
} }
plus.nativeUI.showWaiting();
axios.post("/rest/user/smsLogin", axios.post("/rest/user/smsLogin",
{mobile: phoneNum,smsCode:code,province:province,city:city,region:region,pushClientId:getPushInfo(),deviceId:plus.device.uuid} {mobile: phoneNum,smsCode:code,province:province,city:city,region:region,pushClientId:getPushInfo(),deviceId:plus.device.uuid}
).then(function (response) { ).then(function (response) {
@@ -92,6 +93,10 @@ $("#login_btn").on("click", function () {
} else { } else {
$.toast(resData.message); $.toast(resData.message);
} }
}) plus.nativeUI.closeWaiting();
}).catch(function (error) {
$.toast(error);
plus.nativeUI.closeWaiting();
});
} }
}); });
@@ -176,6 +176,7 @@ var vue = new Vue({
// 绑定手机 // 绑定手机
binding: function() { binding: function() {
if (this.checkMobile() && this.checkSmsCode()) { if (this.checkMobile() && this.checkSmsCode()) {
plus.nativeUI.showWaiting();
axios.post("/rest/user/bindMobile", { axios.post("/rest/user/bindMobile", {
mobile:this.mobile, mobile:this.mobile,
smsCode:this.smsCode, smsCode:this.smsCode,
@@ -201,9 +202,11 @@ var vue = new Vue({
} else { } else {
$.toast(resData.message); $.toast(resData.message);
} }
plus.nativeUI.closeWaiting();
}) })
.catch(function (error) { .catch(function (error) {
$.toast(error); $.toast(error);
plus.nativeUI.closeWaiting();
}); });
} }
} }
+3
View File
@@ -124,6 +124,7 @@ new Vue({
$.toast("请输入密码"); $.toast("请输入密码");
return; return;
} }
plus.nativeUI.showWaiting();
axios.post("/rest/user/passLogin", {mobile:this.mobile, pass: $.md5(this.pass), pushClientId:getPushInfo()}) axios.post("/rest/user/passLogin", {mobile:this.mobile, pass: $.md5(this.pass), pushClientId:getPushInfo()})
.then(function (response) { .then(function (response) {
var resData = response.data; var resData = response.data;
@@ -137,9 +138,11 @@ new Vue({
} else { } else {
$.toast(resData.message); $.toast(resData.message);
} }
plus.nativeUI.closeWaiting();
}) })
.catch(function (error) { .catch(function (error) {
$.toast(error); $.toast(error);
plus.nativeUI.closeWaiting();
}); });
} }
}, },
+3
View File
@@ -115,6 +115,7 @@ new Vue({
$.toast("请输入6位以上数字或字母"); $.toast("请输入6位以上数字或字母");
return; return;
} }
plus.nativeUI.showWaiting();
axios.post("/rest/user/upass", {newPass: $.md5(this.pass)}) axios.post("/rest/user/upass", {newPass: $.md5(this.pass)})
.then(function (response) { .then(function (response) {
var resData = response.data; var resData = response.data;
@@ -124,9 +125,11 @@ new Vue({
} else { } else {
$.toast(resData.message); $.toast(resData.message);
} }
plus.nativeUI.closeWaiting();
}) })
.catch(function (error) { .catch(function (error) {
$.toast(error); $.toast(error);
plus.nativeUI.closeWaiting();
}); });
}, },
/* 密码显示&隐藏 */ /* 密码显示&隐藏 */