From 2513173dde209b4e648d229c0a948ace5b036c6a Mon Sep 17 00:00:00 2001 From: iceling Date: Tue, 14 Jan 2020 15:17:44 +0800 Subject: [PATCH] 请求方法的更新 --- utils/request.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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);} }) } -- libgit2 0.21.4