@extends('layouts.app')

@section('title', '首页')

@section('css')
    <link href="{{ asset('assets/index/css/swiper.min.css') }}" rel="stylesheet" type="text/css"/>
@endsection

@section('content')
    <!-- 新闻公告 -->
    <div class="container">
        <div class="publicTab">
            <ul id="myTabs" class="publicTab-ul" role="tablist">
                <li role="presentation" class="active">
                    <a href="#publicTab01" id="relationTab-01" class="new_list"
                       data-link="{{ getOneCategory(66,'link') }}"
                       role="tab" data-toggle="tab">
                        <img src="/assets/index/images/indexIcon/titleIcon_00.png"/>
                        {{ getOneCategory(66,'title') }}
                    </a>
                </li>
                <li role="presentation" class="">
                    <a href="#publicTab02" id="relationTab-02" class="new_list"
                       data-link="{{ getOneCategory(67,'link') }}"
                       role="tab" data-toggle="tab">
                        <img src="/assets/index/images/indexIcon/titleIcon_01.png"/>
                        {{ getOneCategory(67,'title') }}
                    </a>
                </li>
            </ul>
            <div class="publicTab-more new_list_more" data-href="{{ getOneCategory(66,'link') }}">更多<span>+</span></div>
        </div>
        <div id="myTabContent" class="tab-content publicContent">
            <div role="tabpanel" class="tab-pane fade active in" id="publicTab01">
                <div class="row">
                    @if (getArticlesBYCate(66,7)->isNotEmpty())
                        <div class="col-md-6 col-xs-12">
                            <div class="indexNew-img ce-img">
                                <span style="background-image: url({{getArticlesBYCate(66,8)->first()->cover_url}});"></span>
                            </div>
                        </div>
                        <div class="col-md-6 col-xs-12">
                            <ul class="indexNew-list">
                                @foreach (getArticlesBYCate(66,7) as $info)
                                    <li data-href="{{ $info->link }}">
                                        <div class="publicHover indexNew-name">
                                            <span class="ce-nowrap">{{ $info->title }}</span>{{ $info->created_at->toDateString() }}
                                        </div>
                                        <div class="ce-nowrap-multi indexNew-text">
                                            {{ $info->description }}
                                        </div>
                                    </li>
                                @endforeach
                            </ul>
                        </div>
                    @endif
                </div>
            </div>
            <div role="tabpanel" class="tab-pane fade" id="publicTab02">
                <div class="row">
                    @if (getArticlesBYCate(67,7)->isNotEmpty())
                        <div class="col-md-6 col-xs-12">
                            <div class="indexNew-img ce-img">
                                <span style="background-image: url({{getArticlesBYCate(67,8)->first()->cover_url}});"></span>
                            </div>
                        </div>
                        <div class="col-md-6 col-xs-12">
                            <ul class="indexNew-list">
                                @foreach (getArticlesBYCate(67,7) as $info)
                                    <li data-href="{{ $info->link }}">
                                        <div class="publicHover indexNew-name">
                                            <span class="ce-nowrap">{{ $info->title }}</span>{{ $info->created_at->toDateString() }}
                                        </div>
                                        <div class="ce-nowrap-multi indexNew-text">
                                            {{ $info->description }}
                                        </div>
                                    </li>
                                @endforeach
                            </ul>
                        </div>
                    @endif
                </div>
            </div>
        </div>
    </div>

    <!-- 模块一 -->
    <div class="container">
        <div class="row">
            <div class="col-md-4 col-xs-12">
                <div class="modularOne-label">
                    <img class="modularOne-icon" src="/assets/index/images/indexIcon/titleIcon_02.png"/>
                    <span>{{ getOneCategory(17,'title') }}</span>
                    <img class="modularOne-img" src="/assets/index/images/indexIcon/titleIcon_02.png"/>
                </div>
            </div>
            <div class="col-md-4 col-xs-12">
                <div class="modularOne-label">
                    <img class="modularOne-icon" src="/assets/index/images/indexIcon/titleIcon_03.png"/>
                    <span>{{ getOneCategory(26,'title') }}</span>
                    <img class="modularOne-img" src="/assets/index/images/indexIcon/titleIcon_03.png"/>
                </div>
            </div>
            <div class="col-md-4 col-xs-12">
                <div class="modularOne-label">
                    <img class="modularOne-icon" src="/assets/index/images/indexIcon/titleIcon_04.png"/>
                    <span>{{ getOneCategory(6,'title') }}</span>
                    <img class="modularOne-img" src="/assets/index/images/indexIcon/titleIcon_04.png"/>
                </div>
            </div>
        </div>
    </div>

    <!-- 模块二 -->
    <div class="container">
        {{--科学研究与特色品牌建设--}}
        <div class="publicTab">
            <ul class="publicTab-ul">
                <li role="presentation" class="active">
                    <img src="/assets/index/images/indexIcon/titleIcon_05.png"/>
                    {{ getOneCategory(2,'title') }}
                </li>
            </ul>
            <div class="publicTab-more" data-href="{{ getOneCategory(2,'link') }}">更多<span>+</span></div>
        </div>
        <div class="modularTwo">
            <div class="row">
                @if (getArticlesBYCate(18,10)->isNotEmpty())
                    @foreach (getArticlesBYCate(18,10) as $info)
                        <div class="publicHover modularTwo-list col-xs-12" data-href="{{ $info->link }}">
                            <div class="ce-img modularTwo-list-img">
                                <!-- 图片比例（4:3） -->
                                <span style="background-image: url({{ $info->cover_url }});"></span>
                            </div>
                            <div class="ce-nowrap modularTwo-list-name">{{ $info->title }}</div>
                        </div>
                    @endforeach
                @endif
            </div>
        </div>
    </div>

    <!-- 模块三 -->
    <div class="container">
        {{--省级领军人才梯队--}}
        <div class="publicTab">
            <ul class="publicTab-ul">
                <li role="presentation" class="active">
                    <img src="/assets/index/images/indexIcon/titleIcon_06.png"/>
                    {{ getOneCategory(31,'title') }}
                </li>
            </ul>
        </div>
        <div class="modularThree">
            <div class="row">
                @if (getArticlesBYCate(31,3)->isNotEmpty())
                    @foreach (getArticlesBYCate(31,3) as $info)
                        <div class="publicHover col-md-4 col-xs-12">
                            <div class="modularThree-back">
                                <div class="modularThree-name">{{ $info->title }}</div>
                                <div class="modularThree-list">
                                    <div class="ce-img modularThree-list-img">
                                        <!-- 图片比例（5:3） -->
                                        <span style="background-image: url({{ $info->cover_url }});"></span>
                                    </div>
                                    <div class="ce-nowrap-multi modularThree-list-text">
                                        {{ $info->description }}
                                    </div>
                                </div>
                            </div>
                        </div>
                    @endforeach
                @endif
            </div>
        </div>
    </div>

    <!-- 模块四 -->
    <div class="container">
        {{--院级重点学科--}}
        <div class="publicTab">
            <ul class="publicTab-ul">
                <li role="presentation" class="active">
                    <img src="/assets/index/images/indexIcon/titleIcon_07.png"/>
                    {{ getOneCategory(32,'title') }}
                </li>
            </ul>
        </div>
        <div class="modularThree">
            <div class="row">
                @if (getArticlesBYCate(32,3)->isNotEmpty())
                    @foreach (getArticlesBYCate(32,3) as $info)
                        <div class="publicHover col-md-4 col-xs-12">
                            <div class="modularThree-back">
                                <div class="modularThree-name">{{ $info->title }}</div>
                                <div class="modularThree-list">
                                    <div class="ce-img modularThree-list-img">
                                        <!-- 图片比例（5:3） -->
                                        <span style="background-image: url({{ $info->cover_url }});"></span>
                                    </div>
                                    <div class="ce-nowrap-multi modularThree-list-text">
                                        {{ $info->description }}
                                    </div>
                                </div>
                            </div>
                        </div>
                    @endforeach
                @endif
            </div>
        </div>
    </div>

    <!-- 模块五 -->
    <div class="container">
        <div class="publicTab">
            <ul class="publicTab-ul">
                <li role="presentation" class="active">
                    <img src="/assets/index/images/indexIcon/titleIcon_08.png"/>
                    {{ getOneCategory(5,'title') }}
                </li>
            </ul>
        </div>
        <div class="modularFive">
            <div class="row">
                @if(getCateChild(5,3)->isNotEmpty())
                    @foreach(getCateChild(5,3) as $cate)
                        <div class="col-md-4 col-xs-12">
                            <div class="modularFive-top">
                                <span>{{ $cate->title }}</span>
                            </div>
                            <div class="modularThree-back">
                                <div class="modularThree-list">
                                    <div class="ce-img modularFive-img">
                                        <!-- 图片比例（3:2） -->
                                        <span style="background-image: url({{ $cate->cover_url }});"></span>
                                    </div>
                                    <ul class="modularFive-list">
                                        @if (getArticlesBYCate($cate->id,3)->isNotEmpty())
                                            @foreach (getArticlesBYCate($cate->id,3) as $info)
                                                <li class="publicHover ce-nowrap-multi" data-href="{{ $info->link }}">
                                                    {{ $info->title }}
                                                </li>
                                            @endforeach
                                        @endif
                                    </ul>
                                </div>
                                <div class="modularFive-more" data-href="{{ $cate->link }}">
                                    <span>查看更多</span><img src="/assets/index/images/indexIcon/indexRow.png"/>
                                </div>
                            </div>
                        </div>
                    @endforeach
                @endif
            </div>
        </div>
    </div>

    <!-- 广告图片 -->
    <div class="container">
        <div class="indexAdvert">
            <div class="row">
                <div class="col-xs-12 col-md-12"
                     @if(getOneAdvertByCate(35,'url')) data-href="{{ getOneAdvertByCate(35,'url') }}" @endif>
                    <img src="{{ getOneAdvertByCate(35,'cover_url') }}"/>
                </div>
            </div>
        </div>
    </div>

    <!-- 模块六 -->
    <div class="container">
        <div class="publicTab">
            <ul class="publicTab-ul">
                <li role="presentation" class="active">
                    <img src="/assets/index/images/indexIcon/titleIcon_09.png"/>
                    {{ getOneCategory(43,'title') }}
                </li>
            </ul>
        </div>
        <div class="modularSix">
            <div class="row">
                <div class="col-md-4 col-xs-12">
                    <div class="modularThree-back">
                        @if (getArticlesBYCate(43,3,1)->isNotEmpty())
                            @foreach (getArticlesBYCate(43,3,1) as $info)
                                <div class="ce-img modularSix-img" data-href="{{ $info->link }}">
                                    <!-- 图片比例（5:3） -->
                                    <span style="background-image: url({{ $info->cover_url }});"></span>
                                    <div class="ce-nowrap modularThree-img-title">   {{ $info->title }}</div>
                                </div>
                            @endforeach
                        @endif
                    </div>
                </div>
                <div class="col-md-8 col-xs-12">
                    <div class="modularThree-back modularSix-space">
                        <div class="row">
                            @if (getArticlesBYCate(43,14)->isNotEmpty())
                                @foreach (getArticlesBYCate(43,14) as $info)
                                    <div class="col-md-4 col-xs-12 modularSix-padding" data-href="{{ $info->link }}">
                                        <div class="modularSix-label">
                                            <div class="modularSix-label-cont">
                                                <img src="{{ $info->logo_url }}"/>
                                                <span>{{ $info->title }}</span>
                                            </div>
                                        </div>
                                    </div>
                                @endforeach
                            @endif
                            <div class="col-md-4 col-xs-12 modularSix-padding">
                                <div class="modularSix-label">
                                    <div class="modularSix-label-cont" data-href="{{ getOneCategory(43,'link') }}">
                                        <img src="/assets/index/images/indexIcon/titleTem_14.png"/>
                                        <span>查看更多 &gt;&gt;</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- 模块七 -->
    <div class="container">
        <div class="modularSever">
            <div class="row">
                {{--人才队伍--}}
                <div class="col-xs-12 col-md-9">
                    <div class="publicTab" style="margin-bottom: 0">
                        <ul class="publicTab-ul">
                            <li role="presentation" class="active">
                                <img src="/assets/index/images/indexIcon/titleIcon_10.png"/>
                                {{ getOneCategory(3,'title') }}
                            </li>
                        </ul>
                        <div class="publicTab-more" data-href="{{ getOneCategory(3,'link') }}">更多<span>+</span></div>
                    </div>
                    <div class="modularThree-back modularSix-space">
                        <div class="row">
                            @if(getCateChild(42)->isNotEmpty())
                                @foreach(getCateChild(42) as $cate)
                                    <div class="col-xs-12 col-md-4 modularSix-padding" data-href="{{ $cate->link }}">
                                        <div class="modularServe-label">
                                            <span> {{ $cate->title }}</span>
                                        </div>
                                    </div>
                                @endforeach
                            @endif
                        </div>
                    </div>
                </div>
                {{--政府决策服务--}}
                <div class="col-xs-12 col-md-3">
                    <div class="publicTab" style="margin-bottom: 0">
                        <ul class="publicTab-ul">
                            <li role="presentation" class="active">
                                <img src="/assets/index/images/indexIcon/titleIcon_11.png"/>
                                {{ getOneCategory(27,'title') }}
                            </li>
                        </ul>
                    </div>
                    <div class="modularThree-back">
                        <ul class="modularServe-list">
                            @if (getArticlesBYCate(27,5)->isNotEmpty())
                                @foreach (getArticlesBYCate(27,5) as $info)
                                    <li data-href="{{ $info->link }}">
                                        <div class="ce-nowrap publicHover modularServe-name">
                                            {{ $info->title }}
                                        </div>
                                    </li>
                                @endforeach
                            @endif
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- 模块七 -->
    <div class="container">
        <div class="modularEight">
            <div class="row">
                @if(getCateChild(73))
                    @foreach(getCateChild(73) as $cate)
                        <div class="col-xs-12 col-md-3"
                             @if($cate->url && $cate->type=='link')
                             data-href="{{ $cate->url }}"
                                @endif
                        />
                        <div class="modularEight-label"
                             style="background-image: url({{ $cate->cover_url }});">
                            <div class="modularEight-title">{{ $cate->title }}</div>
                        </div>
            </div>
            @endforeach
            @endif
        </div>
    </div>
    </div>

@endsection

@push('script')
    <script type="text/javascript">
        $(document).ready(function () {
            $('.new_list').click(function () {
                var link = $(this).data('link');

                $('.new_list_more').attr('data-href', link)
            });
        });

    </script>
@endpush
