diff --git a/utils/request.js b/utils/request.js index 8b803ed..4c49293 100644 --- a/utils/request.js +++ b/utils/request.js @@ -116,7 +116,8 @@ module.exports = { }, showLoading: function() { wx.showLoading({ - title: "加载中" + title: "加载中", + mask:true, }); }, hideLoading: function() { @@ -220,6 +221,8 @@ module.exports = { * @param {Object} fail //失败的回调 */ json_post:function(url,data,succ,fail){ + var th=this; + this.showLoading(); if(url.indexOf("http")==-1) url=getApp().globalData.setting.url +url; var str = JSON.stringify(data); wx.request({ @@ -229,7 +232,7 @@ module.exports = { header: { 'content-type': 'application/json' },// 设置请求的 header - success: function (res) { succ(res); }, + success: function (res) { succ(res);th.hideLoading(); }, fail:function(res){fail(res);} }) }