function showind_wx(id,order_id){
    var query = new Object();
    query.id = id;
    $.ajax({
        type:'GET',
        url: APP+"Mobile/Index/get_coupons_wx.html",
        data:query,
        success:function(data){
            //alert(JSON.stringify(data));
            if(data.status == 0){
                window.location.href = data.url;
            }
            if(data.status == 2){
                $.showSuccess(data.msg,3,'hc');return;
            }
            if(data.wx == 1){
                wx.addCard({
                    cardList: [{
                        cardId : data.cardId,
                        cardExt: '{"timestamp":"'+data.cardExt.timestamp+'","signature":"'+data.cardExt.signature+'","nonce_str":"'+data.cardExt.nonce_str+'"}'
                    }], // 需要添加的卡券列表
                    success: function (res) {
                        // alert('已添加卡券：' + JSON.stringify(res.errMsg)); // 添加的卡券列表信息
                        if(res.errMsg == 'addCard:ok'){
                            showind(id,order_id)
                        }
                    }
                });
            }else{
                showind(id,order_id)
            }
        }
    });
}

function showind(id,order_id){
    hidewind();
    var obj = '#sub_'+id;
    if($(obj).hasClass('submitting_'+id)){return;}
    $(obj).addClass('submitting_'+id);
    var num = $(obj).val();
    var query = new Object();
    query.id = id;
    query.order_id = order_id;
    $.ajax({
        type:'GET',
        url: APP+"Mobile/Index/get_coupons.html",
        data:query,
        success:function(data){
            if(data.status == 1){
                $.showSuccess('领取成功',3,'hc');
            }else if(data.status == 0){
                window.location.href = data.url;
            }else if(data.status == 2){
                $.showSuccess(data.msg,3,'hc');
            }
        }
    });
    $(obj).removeClass('submitting_'+id);
}
function hidewind(){
    $(".mask").hide();
    $("#lingqu").hide();
}