DataConfig = function (){

}
DataConfig.urlFun = "/exhibition/detail?number=3&";
DataConfig.gzFun = "/exhibition/give_applause?id=";//鼓掌
DataConfig.shFun = "/exhibition/send_flower?id=";//花
DataConfig.dzFun = "/exhibition/like?id=";//点赞

DataConfig.getAllData = function (id,callback){
    var data = {
        "id":id
    };
    let url = DataConfig.urlFun+"id="+id
    if (ignoreVisit == "1") {
        url += "&ignore_visit=1"
    }
    Request.sendMessage(url, (res)=>{
        if(res){
            console.log("onsuccess");
            if(callback){
                callback(res);
            }
        }
    })
}
DataConfig.getGuZhang = function (id, callback){
    Request.sendMessage(DataConfig.gzFun+id, (res)=>{
        if(res){
            console.log("onsuccess");
            if(callback){
                callback(res.count);
            }
        }
    })
}
DataConfig.getDianZa = function (id, callback){
    Request.sendMessage(DataConfig.dzFun+id, (res)=>{
        if(res){
            console.log("onsuccess");
            if(callback){
                callback(res.count);
            }
        }
    })
}
DataConfig.getSongHua = function (id, callback){
    Request.sendMessage(DataConfig.shFun+id, (res)=>{
        if(res){
            console.log("onsuccess");
            if(callback){
                callback(res.count);
            }
        }
    })
}
Request.sendMessage = function (url, onSuccess) {
    var objValue = {type: 'get',timeout : 1000, url: url,dataType:'json',contentType: "application/json;charset=UTF-8",
        success: function (response) {
            if(response != null){
                if(onSuccess){
                    onSuccess(response);
                }
            }
        },
        error:function (XMLHttpRequest, textStatus) {
            console.log(XMLHttpRequest)
            onSuccess(null);
        }
    };
    $.ajax(objValue);
}
