﻿//获取登录状态
jQuery.GetIsAuthenticated = function(callback) {
    $.ajax({
        type: "POST", 
        contentType: "application/json", 
        url: "/webservices/user.asmx/GetIsAuthenticated",
        data: "{}",
        dataType: 'json',
        cache: false, 
        success: function(result) {
            callback(result.d);
        }
    });
}

///返回已经登录的会员ID
jQuery.GetUserID = function(callback) {
    $.ajax({
        type: "POST",
        contentType: "application/json",
        url: "/webservices/user.asmx/GetUserID",
        data: "{}",
        dataType: 'json',
        success: function(result) {
            callback(result.d);
        }
    });
}

///返回购物车数量
jQuery.GetMyCartGoodsCount = function(callback) {
    $.ajax({
        type: "POST",  
        contentType: "application/json", 
        url: "/webservices/user.asmx/GetMyCartGoodsCount", 
        data: "{}",
        dataType: 'json',
        success: function(result) {      
            callback(result.d);
        }
    });
}


//返回电子邮件是否已经存在
jQuery.GetEmailIsExist = function(vEmail, callback) {
    $.ajax({
        type: "POST",
        contentType: "application/json",
        url: "/webservices/user.asmx/GetEmailIsExist",
        data: "{Email:'" + vEmail + "'}",
        dataType: 'json',
        success: function(result) {
            callback(result.d);
        }
    });
}

//返回手机号码是否已经存在
jQuery.GetMobileExist = function(vMobile,callback) {
    $.ajax({
        type: "POST",
        contentType: "application/json",
        url: "/webservices/user.asmx/GetMobileExist",
        data: "{Mobile:'" + vMobile + "'}",
        dataType: 'json',
        success: function(result) {
            callback(result.d);
        }
    });
}

