@extends('base.base')
@section('base')
    <!-- 内容区域 -->
    <div class="main-panel">
        <div class="content-wrapper">
            <div class="page-header">
                <h3 class="page-title">
                     <span class="page-title-icon bg-gradient-primary text-white mr-2">
                        <i class="mdi mdi-settings"></i>
                    </span>
                    {{ __('auto.咖啡渠道修改') }}
                </h3>
                <nav aria-label="breadcrumb">
                    <ol class="breadcrumb">
                        <li class="breadcrumb-item"><a href="#">{{ __('auto.咖啡管理') }}</a></li>
                        <li class="breadcrumb-item active" aria-current="page">{{ __('auto.咖啡渠道修改') }}</li>
                        <li class="breadcrumb-item active" aria-current="page">{{ __('auto.查看渠道') }}</li>
                    </ol>
                </nav>
            </div>
            <div class="row">
                <div class="col-lg-12 grid-margin stretch-card">
                    <div class="card">
                        <div class="card-body">
                            <h4 class="card-title">{{ __('auto.查看渠道') }}</h4>

                                <form action="" method="post" class="form-inline form-ajax">
                                    {!! csrf_field() !!}
                                    @foreach($list as $k => $v)
                                        <div style="margin: 5px 0; width: 100%;">
                                            <div class="form-group">
                                                <label for="">{{ __('auto.权重') }}:</label>
                                                <input class="form-control" type="text"
                                                       name="config[{{$v->id}}][sort]" value="{{$v->sort}}">
                                                <label for="">{{ __('auto.渠道名称') }}:</label>
                                                <input class="form-control" type="text" disabled value="{{ $v->name }}">
                                                <label for="">{{ __('auto.当前状态') }}:</label>
                                                @component('components.select', [
                                                    'name' => "config[{$v->id}][status]",
                                                    'class' => $v->status == 1 ? 'btn-primary' : 'btn-danger',
                                                    'options' => [1 => __('auto.开启'), -1 => __('auto.关闭')],
                                                    'default' => $v->status])
                                                @endcomponent
                                            </div>

                                        </div>
                                    @endforeach
                                    <div>
                                        <button class="btn btn-sm btn-primary">{{ __('auto.提交') }}</button>
                                    </div>
                                </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection
