//点击统计
function clickStatistics(baseUrl,moduleName,pageName,errorCallback){
	var url = baseUrl + '/B/android';
	var parameters = {'actionCode':'B016','deviceId':'weixin','appVersion':'1.0','appstatics':[{'moduleName':moduleName,'pageName':pageName,'createDate':new Date().getTime()}]};
	postData(url, JSON.stringify(parameters), clickStatisticsSuccess, errorCallback);
}

function clickStatisticsSuccess(data){
	if(!data.success){
		showMsg(data.message);
	}
}

function goToHome(baseUrl){
	window.location.href = baseUrl + '/web/ssdb/search';
}

//回到顶部
function pageScroll() {
    $("#goTop").trigger('click');
}

//向后台请求数据
function postData(url, parameters, successCallback, errorCallback){
	$.ajax({
	    type : "POST",
	    url : url,
	    data : parameters,
	    dataType : "json",
	    success : function(data) {
	    	successCallback(data); 
	    },
	    error : function(data) {
	    	errorCallback(data);
	    }
    }); 
}

//向后台请求数据默认错误回调
function postDataDefaultErrorCallback(data){
	if(data){
		showMsg(data.message);
	}else{
		showMsg("网络异常");
	}
}

//向后台请求数据默认成功回调
function postDataDefaultSuccessCallback(data){
	console.log(data);
}

//显示信息
function showMsg(msg){
	if(msg != undefined && msg.length > 0){
		alert(msg);
	}
}
