/**
 * 处理请求loading
 * 接收一个boolean值，如果为true则loading + 1，否则loading -1
 */
let requestNum = 0;
const handleReqLoading = (loadingStatus) => {
    if (loadingStatus) {
        requestNum++;
    } else {
        requestNum--;
    }
    if (requestNum < 0) {
        requestNum = 0;
    }
    if (requestNum > 0) {
        uni.showLoading({
        title: '加载中',
        mask: true
        });
    } else {
        uni.hideLoading();
    }

}

export default handleReqLoading;