//批量取消推荐轮播或者栏目轮播
function channelSlide(type)
{
    var data = tableCheck.getData();
    if (data.length==0)
    {
        layer.msg('请选择数据！',{icon:5});
        return;
    }
    if(type == 'home') titlemsg = '推荐';
    else titlemsg = '本栏目';
    layer.confirm('您确认要批量取消'+titlemsg+'轮播数据吗？',function(){
        var ids = data.join('_');
        //发异步删除数据
        var i = layer.load(1);
        fetch_response('GET','/web/news/channelSlide/'+ids+'/'+type)
        .then(function(response){
            if (response['code'] == 200) {
                layer.close(i);
                layer.msg('提交成功',{icon:6},function(){
                    window.location.reload();
                });
            } else {
                layer.close(i);
                layer.msg('提交失败:'+response.msg,{icon:5})
                }
            })
        });
}

//批量取消推荐轮播或者栏目置顶
function channelTop(type)
{
    var data = tableCheck.getData();
    if (data.length==0)
    {
        layer.msg('请选择数据！',{icon:5});
        return;
    }
    if(type == 'home') titlemsg = '推荐';
    else titlemsg = '本栏目';
    layer.confirm('您确认要批量取消'+titlemsg+'置顶数据吗？',function(){
        var ids = data.join('_');
        //发异步删除数据
        var i = layer.load(1);
        fetch_response('GET','/web/news/channelTop/'+ids+'/'+type)
        .then(function(response){
            if (response['code'] == 200) {
                layer.close(i);
                layer.msg('提交成功',{icon:6},function(){
                    window.location.reload();
            });
            } else {
                layer.close(i);
                layer.msg('提交失败:'+response.msg,{icon:5})
            }
        })
    });
}