This commit is contained in:
2021-01-22 13:41:40 +08:00
parent a3c427d0f9
commit b2c4ba053f
7 changed files with 166 additions and 43 deletions

View File

@@ -21,6 +21,13 @@ class PictureController extends AdminController
$filter->column(1 / 2, function ($filter) { $filter->column(1 / 2, function ($filter) {
$filter->like('title', '文章标题'); $filter->like('title', '文章标题');
}); });
$filter->column(1 / 2, function ($filter) {
$filter->like('category.id', '所属分类')
->select(Category::selectOptions(function ($model) {
return $model->where('status', 1)
->whereIn('type', [Category::TYPE_PICTURE]);
}, '所有分类'));
});
$filter->disableIdFilter(); $filter->disableIdFilter();
}); });

View File

@@ -17,7 +17,12 @@ class IndexController extends Controller
public function index() public function index()
{ {
//随手拍 //随手拍
$ssp = ArticlePicture::orderBy('sort', 'desc')->where('category_id', 6)->take(3)->get(); $ssp = ArticlePicture::latest()
->where('category_id', 6)
->where('pictures', '<>', '[]')
->take(4)
->get();
//最新资讯 //最新资讯
$all_articles = Article::latest() $all_articles = Article::latest()
->whereNotIn('category_id', [20, 21, 22]) ->whereNotIn('category_id', [20, 21, 22])

View File

@@ -230,17 +230,18 @@ ul.listul li .newsr .more{color:#ff6600;display: inline-block;margin-top: 20px;}
.idxShoot-title-name{flex: 1; display: flex;} .idxShoot-title-name{flex: 1; display: flex;}
.idxShoot-title a {color: #999999; font-size: 15px;} .idxShoot-title a {color: #999999; font-size: 15px;}
.idxShoot-swiper{ position: relative; margin-right: 10px;} .idxShoot-swiper{ position: relative; margin-right: 10px; width: 590px;}
.gallery-top {padding-top: 86%;width: 100%;} .gallery-top {padding-top: 86%;width: 590px;}
.gallery-top .swiper-wrapper{position: absolute; top: 0; left: 0; height: calc(75% - 10px); margin-bottom: 20px;} .gallery-top .swiper-wrapper{position: absolute; top: 0; left: 0; height: calc(75% - 10px); margin-bottom: 20px;}
.gallery-top .swiper-slide{background-size: cover} .gallery-top .swiper-slide{background-size: cover}
.gallery-thumbs{position: absolute; width: 100%; height: 25%; bottom: 0; left: 0;} .gallery-thumbs{position: absolute; width: 100%; height: 25%; bottom: 0; left: 0;}
.gallery-thumbs .swiper-slide {border: 3px solid #fff; background-size: cover; margin-right: 4px !important;} .gallery-thumbs .swiper-slide {border: 3px solid #fff; background-size: cover; margin-right: 4px !important;}
.gallery-thumbs .swiper-slide-active {border: 3px solid #b9202f; height: calc(100% - 6px)} .gallery-thumbs .swiper-slide-active {border: 3px solid #b9202f; height: calc(100% - 6px)}
.idxNews-ul{box-shadow: 0 0 10px rgba(0,0,0,.2); overflow: hidden; margin-left: 10px; padding: 15px 15px 0; box-sizing: border-box;} .idxNews-ul{box-shadow: 0 0 10px rgba(0,0,0,.2); overflow: hidden; margin-left: 10px; padding: 15px 15px 0; box-sizing: border-box;}
.idxNews-ul li{height: 42px; transition: .5s; border-bottom: 1px solid #ececec;margin-bottom: 18px; overflow: hidden;} .idxNews-ul li{transition: .5s; border-bottom: 1px solid #ececec;margin-bottom: 18px; overflow: hidden;}
.idxNews-ul li:last-child {margin-bottom: 0; border: none;} .idxNews-ul li:last-child {margin-bottom: 0; border: none;}
.idxNews-ul li:first-child .idxNews-ul-title::after { background-image: url(../images/idx/idxNew_img_active.png); } .idxNews-ul li:first-child .idxNews-ul-title::after { background-image: url(../images/idx/idxNew_img_active.png); }
.idxNews-ul li:first-child { height: 115px } .idxNews-ul li:first-child { height: 115px }
@@ -274,7 +275,7 @@ ul.listul li .newsr .more{color:#ff6600;display: inline-block;margin-top: 20px;}
display: block;} display: block;}
.idxHealthUl>li:nth-child(2) .idxHealthUl-img {bottom: 0; top: auto;} .idxHealthUl>li:nth-child(2) .idxHealthUl-img {bottom: 0; top: auto;}
.idxHealthUl>li:nth-child(2) .idxHealthUl-text {top: 0;} .idxHealthUl>li:nth-child(2) .idxHealthUl-text {top: 0;}
.idxHealthUl>li:nth-child(2) .idxHealthUl-title {margin: 0 0 10px;} /* .idxHealthUl>li:nth-child(2) .idxHealthUl-title {margin: 0 0 10px;} */
.idxPoster{background-size: cover; background-repeat: no-repeat; background-position: center; width: 100%; height: 200px;} .idxPoster{background-size: cover; background-repeat: no-repeat; background-position: center; width: 100%; height: 200px;}
.recomdUl{display: flex; margin: 0 -5px;} .recomdUl{display: flex; margin: 0 -5px;}

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 KiB

File diff suppressed because one or more lines are too long

View File

@@ -2,6 +2,64 @@
@section('title', '首页') @section('title', '首页')
@section('css')
<style>
.gallery-thumbs .swiper-slide {
border: 3px solid #fff;
height: calc(100% - 6px);
}
.gallery-thumbs .swiper-slide-thumb-active {
border: 3px solid #b9202f;
height: calc(100% - 6px);
}
.idxShoot {
padding-bottom: 10px;
}
.idxSurveyCont-right::after {
display: none;
}
.idxNews-ul-title {
margin-bottom: 0;
}
.idxSurveyContImg {
width: 100px;
height: 80px;
margin-right: 20px;
}
.idxSurveyCont-left {
width: calc(100% - 120px);
margin-right: 0;
line-height: 28px;
}
.idxNews-ul-title a {
width: 70%
}
.idxNews-ul li:first-child p {
height: 60px;
white-space: normal;
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2
}
.idxHealthUl-text a {
margin-bottom: 20px
}
</style>
@endsection
@section('content') @section('content')
<!-- 随手拍+最新资讯 --> <!-- 随手拍+最新资讯 -->
@@ -18,7 +76,8 @@
<div class="swiper-wrapper"> <div class="swiper-wrapper">
@foreach ($ssp as $element) @foreach ($ssp as $element)
@foreach ($element->pictures as $picture) @foreach ($element->pictures as $picture)
<div class="swiper-slide" style="background-image:url({{ Storage::disk('public')->url($picture ) }})"></div> <div class="swiper-slide"
style="background-image:url({{ Storage::disk('public')->url($picture ) }})"></div>
@endforeach @endforeach
@endforeach @endforeach
</div> </div>
@@ -28,7 +87,8 @@
<div class="swiper-wrapper"> <div class="swiper-wrapper">
@foreach ($ssp as $element) @foreach ($ssp as $element)
@foreach ($element->pictures as $picture) @foreach ($element->pictures as $picture)
<div class="swiper-slide" style="background-image:url({{ Storage::disk('public')->url($picture ) }})"></div> <div class="swiper-slide"
style="background-image:url({{ Storage::disk('public')->url($picture ) }})"></div>
@endforeach @endforeach
@endforeach @endforeach
</div> </div>
@@ -46,10 +106,11 @@
<li> <li>
<div class="idxNews-ul-title"> <div class="idxNews-ul-title">
<a href="{{ route('article.show', $article) }}"> <a href="{{ route('article.show', $article) }}">
<p class="ce-nowrap-multi" style="margin-right:10px">{{ $article->title }}</p></a> <p class="ce-nowrap"
style="margin-right:10px;height: 43px;">{{ $article->title }}</p></a>
<span>{{ $article->created_at }}</span> <span>{{ $article->created_at }}</span>
</div> </div>
<div class="ce-nowrap-multi idxNews-ul-text"> <div class="ce-nowrap idxNews-ul-text">
{{ $article->description }} {{ $article->description }}
</div> </div>
</li> </li>
@@ -66,18 +127,22 @@
<p>期刊简介</p> <p>期刊简介</p>
<span>/ INTRODUCTION OF THE JOURNAL</span> <span>/ INTRODUCTION OF THE JOURNAL</span>
</div> </div>
<a href="@if ($danwei) {{ route('article.show', $danwei) }} @endif">更多 &gt;</a> <a href="@if ($danwei) {{ route('article.show', $danwei) }} @endif">更多 &gt;</a>
</div> </div>
<div class="idxSurveyCont"> <div class="idxSurveyCont">
<div class="idxSurveyCont-left"> {{-- <img class="idxSurveyContImg" src=" @if ($danwei) {{ $danwei->cover_path }} @endif">--}}
@if ($danwei) {{ $danwei->description }} @endif {{-- <div class="idxSurveyCont-left">--}}
{{-- @if ($danwei) {{ $danwei->description }} @endif--}}
</div> {{-- </div>--}}
<div class="idxSurveyCont-right"> {{-- <div class="idxSurveyCont-right">--}}
<div class="idxSurveyCont-right-img"> {{-- <div class="idxSurveyCont-right-img">--}}
<img src=" @if ($danwei) {{ $danwei->cover_path }} @endif">
</div> {{-- </div>--}}
</div> {{-- </div> --}}
@if($danwei)
<img style="width: 100%" src="{{ $danwei->cover_path }} ">
@endif
</div> </div>
</div> </div>
@@ -90,13 +155,13 @@
</div> </div>
<ul class="idxHealthUl"> <ul class="idxHealthUl">
@foreach ($ysbj as $article) @foreach ($ysbj as $article)
<li> <li style="box-shadow: 0 0 20px rgba(0,0,0,.2);">
<div class="ce-img idxHealthUl-img"> <div class="ce-img idxHealthUl-img">
<span style="background-image: url( {{ $article->cover_path }} );"></span> <span style="background-image: url( {{ $article->cover_path }} );"></span>
</div> </div>
<div class="idxHealthUl-text"> <div class="idxHealthUl-text" style="text-align: center; width: 100%;">
<div class="idxHealthUl-title">{{ $article->title }}</div> <div class="idxHealthUl-title">{{ $article->title }}</div>
<div class="idxHealthUl-tips"> <div class="idxHealthUl-tips" style="text-align: center;margin: 0;">
{{ $article->description }} {{ $article->description }}
</div> </div>
<a href="{{ route('article.show', $article) }}"> <a href="{{ route('article.show', $article) }}">
@@ -134,11 +199,11 @@
@if ($dcyfx->isNotEmpty()) @if ($dcyfx->isNotEmpty())
<div class="recomdUl-top"> <div class="recomdUl-top">
<div class="ce-img recomdUl-top-img"> <div class="ce-img recomdUl-top-img" style="height: 90px;">
<span style="background-image: url({{ $dcyfx->first()->cover_path }});"></span> <span style="background-image: url({{ $dcyfx->first()->cover_path }});"></span>
</div> </div>
<div class="recomdUl-top-text"> <div class="recomdUl-top-text">
<p class="ce-nowrap"> <p class="ce-nowrap-multi">
<a href="{{ route('article.show', $dcyfx->first()) }}"> {{ $dcyfx->first()->title }}</a> <a href="{{ route('article.show', $dcyfx->first()) }}"> {{ $dcyfx->first()->title }}</a>
</p> </p>
<span class="ce-nowrap-multi">{{ $dcyfx->first()->description }}</span> <span class="ce-nowrap-multi">{{ $dcyfx->first()->description }}</span>
@@ -147,7 +212,7 @@
<ul class="recomdUl-list"> <ul class="recomdUl-list">
@foreach ($dcyfx as $article) @foreach ($dcyfx as $article)
@if ($loop->iteration>1) @if ($loop->iteration>1)
<li class="ce-nowrap"> <li class="ce-nowrap-multi">
<a href="{{ route('article.show', $article) }}"> <a href="{{ route('article.show', $article) }}">
{{ $article->title }} {{ $article->title }}
</a> </a>
@@ -168,11 +233,11 @@
@if ($yyjcyj->isNotEmpty()) @if ($yyjcyj->isNotEmpty())
<div class="recomdUl-top"> <div class="recomdUl-top">
<div class="ce-img recomdUl-top-img"> <div class="ce-img recomdUl-top-img" style="height: 90px;">
<span style="background-image: url({{ $yyjcyj->first()->cover_path }});"></span> <span style="background-image: url({{ $yyjcyj->first()->cover_path }});"></span>
</div> </div>
<div class="recomdUl-top-text"> <div class="recomdUl-top-text">
<p class="ce-nowrap"> <p class="ce-nowrap-multi">
<a href="{{ route('article.show', $yyjcyj->first()) }}"> {{ $yyjcyj->first()->title }}</a> <a href="{{ route('article.show', $yyjcyj->first()) }}"> {{ $yyjcyj->first()->title }}</a>
</p> </p>
<span class="ce-nowrap-multi">{{ $yyjcyj->first()->description }}</span> <span class="ce-nowrap-multi">{{ $yyjcyj->first()->description }}</span>
@@ -181,7 +246,7 @@
<ul class="recomdUl-list"> <ul class="recomdUl-list">
@foreach ($yyjcyj as $article) @foreach ($yyjcyj as $article)
@if ($loop->iteration>1) @if ($loop->iteration>1)
<li class="ce-nowrap"> <li class="ce-nowrap-multi">
<a href="{{ route('article.show', $article) }}"> <a href="{{ route('article.show', $article) }}">
{{ $article->title }} {{ $article->title }}
</a> </a>
@@ -203,11 +268,11 @@
@if ($jsyt->isNotEmpty()) @if ($jsyt->isNotEmpty())
<div class="recomdUl-top"> <div class="recomdUl-top">
<div class="ce-img recomdUl-top-img"> <div class="ce-img recomdUl-top-img" style="height: 90px;">
<span style="background-image: url({{ $jsyt->first()->cover_path }});"></span> <span style="background-image: url({{ $jsyt->first()->cover_path }});"></span>
</div> </div>
<div class="recomdUl-top-text"> <div class="recomdUl-top-text">
<p class="ce-nowrap"> <p class="ce-nowrap-multi">
<a href="{{ route('article.show', $jsyt->first()) }}"> {{ $jsyt->first()->title }}</a> <a href="{{ route('article.show', $jsyt->first()) }}"> {{ $jsyt->first()->title }}</a>
</p> </p>
<span class="ce-nowrap-multi">{{ $jsyt->first()->description }}</span> <span class="ce-nowrap-multi">{{ $jsyt->first()->description }}</span>
@@ -216,7 +281,7 @@
<ul class="recomdUl-list"> <ul class="recomdUl-list">
@foreach ($jsyt as $article) @foreach ($jsyt as $article)
@if ($loop->iteration>1) @if ($loop->iteration>1)
<li class="ce-nowrap"> <li class="ce-nowrap-multi">
<a href="{{ route('article.show', $article) }}"> <a href="{{ route('article.show', $article) }}">
{{ $article->title }} {{ $article->title }}
</a> </a>
@@ -285,7 +350,8 @@
</div> </div>
<div class="idxWeekly-ul"> <div class="idxWeekly-ul">
@foreach ($qikan_advert as $advert) @foreach ($qikan_advert as $advert)
<div class="idxWeekly-back" style="background-image: url({{ $advert->one_picture_path }});"></div> <div class="idxWeekly-back"
style="background-image: url({{ $advert->one_picture_path }});"></div>
@endforeach @endforeach
</div> </div>
</div> </div>
@@ -296,20 +362,42 @@
@push('script') @push('script')
<script type="text/javascript" src="{{ asset('assets/index/js/swiper-bundle.min.js') }}"></script>
<script> <script>
var galleryTop = new Swiper('.gallery-top', {
spaceBetween: 10,
loop: true
});
var galleryThumbs = new Swiper('.gallery-thumbs', { var galleryThumbs = new Swiper('.gallery-thumbs', {
spaceBetween: 10, spaceBetween: 10,
slidesPerView: 3, slidesPerView: 3,
touchRatio: 0.2,
loop: true, loop: true,
slideToClickedSlide: true freeMode: true,
loopedSlides: 3, //looped slides should be the same
watchSlidesVisibility: true,
watchSlidesProgress: true,
}); });
galleryTop.params.control = galleryThumbs; var galleryTop = new Swiper('.gallery-top', {
galleryThumbs.params.control = galleryTop; spaceBetween: 10,
loop: true,
loopedSlides: 3, //looped slides should be the same
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
thumbs: {
swiper: galleryThumbs,
},
});
// var galleryTop = new Swiper('.gallery-top', {
// spaceBetween: 10,
// loop: true
// });
// var galleryThumbs = new Swiper('.gallery-thumbs', {
// spaceBetween: 10,
// slidesPerView: 3,
// touchRatio: 0.3,
// loop: true,
// slideToClickedSlide: true
// });
// galleryTop.params.control = galleryThumbs;
// galleryThumbs.params.control = galleryTop;
// 期刊 // 期刊

View File

@@ -86,11 +86,11 @@
<span>编委会</span> <span>编委会</span>
<ul class="idxFooter-ul"> <ul class="idxFooter-ul">
<li> <li>
&nbsp;&nbsp;&nbsp;任: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;任:
@if($manage_users->isNotEmpty()){{ $manage_users->first()->title }} @endif @if($manage_users->isNotEmpty()){{ $manage_users->first()->title }} @endif
</li> </li>
<li> <li>
主任 &nbsp;&nbsp;&nbsp;
@if($manage_users->isNotEmpty()) @if($manage_users->isNotEmpty())
@foreach ($manage_users as $users) @foreach ($manage_users as $users)
@if ($loop->iteration>1) @if ($loop->iteration>1)
@@ -99,6 +99,14 @@
@endforeach @endforeach
@endif @endif
</li> </li>
<li>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 编:
@if($manage_users->isNotEmpty()){{ $manage_users->first()->title }} @endif
</li>
<li>
执行主编:
曹彦
</li>
</ul> </ul>
</div> </div>
<div class="idxFooter-name"> <div class="idxFooter-name">