function get_gift(){
    $("#hg_goods").removeClass('hide');
    $(".popmask0").removeClass('hide');
}
function close_gift(){
    $("#hg_goods").addClass('hide');
    $(".popmask0").addClass('hide');
}
function check_goods(){
    close_gift();
    var cart_ids=$("#cart_ids").val();
    var pro_id=$("#pro_id").val();
    var querydata = new Object;
    querydata['id'] = new Object;
    querydata['cart_ids'] = cart_ids;
    querydata['pro_id'] = pro_id;
    $('input[name="goods_id[]"]').each(function () {
        if($(this).is(":checked")){
            $(this).parent().siblings().find("input:checkbox").attr('checked',false);
            var goods_id = $(this).val();
            var goods_attr = $(this).attr('rel');
            //del_goods('#del_cart' + cart_id);
            querydata['id']=goods_id;
            querydata['goods_attr']=goods_attr;
        }

    });
    $.ajax({
        url: APP + "Mobile/Cart/add_pro_goods",
        type: "post",
        data: querydata,
        dataType: "json",
        success: function (ret) {
            if(ret.status==1){
                showtoast("选择成功");
                var body = $('body').css("position");
                if(body=='relative'){
                    $('body').css("position","");
                }
            }else{
                showtoast(ret.msg);
                var body = $('body').css("position");
                if(body=='relative'){
                    $('body').css("position","");
                }
            } //$.showErr(ret.msg,0,'hc');
        }
    });
}