@extends('layouts.app')

@section('content')

    <!-- 新闻动态 -->
    <div class="survey" style="background-image: url(/assets/index/images/newsBack.png);">
        <div class="container">
            <div class="row">
                @include('category.left')
                <div class="col-xs-12 col-md-9 secondRight">
                    <!-- 获得奖项 -->
                    <div class="surveyCont">
                        <div class="secondTop">
                            <div class="secondTop-name">
                                <img src="/assets/index/images/surveyIcon_01.png"/>
                                {{ getOneCategory(10,'title') }}
                            </div>
                        </div>
                        <div class="swiper-container newPrize-swiper">
                            <div class="swiper-wrapper">
                                @if (getArticlesBYCate(10,8)->isNotEmpty())
                                    @foreach (getArticlesBYCate(10,8) as $article)
                                        <div class="swiper-slide indexPrize-ul" data-href="{{ $article->link }}">
                                            <div class="ce-img indexPrize-img">
                                                <span style="background-image: url({{ $article->cover_path }});"></span>
                                            </div>
                                            <div class="ce-nowrap indexPrize-title">
                                                {{ $article->title }}
                                            </div>
                                        </div>
                                    @endforeach
                                @endif
                            </div>
                            <!-- Add Pagination -->
                            <div class="swiper-pagination newPrize-pagination"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection
@push('script')
    <script type="text/javascript">
        // 获得奖项
        var mySwiper = new Swiper('.newPrize-swiper', {
            pagination: '.newPrize-pagination',
            slidesPerView: 3,
            paginationClickable: true,
            spaceBetween: 30,
            autoplay: 2000
        });
    </script>
@endpush