From 703718085048b24a60ae38d32f21d15835a63178 Mon Sep 17 00:00:00 2001 From: xuanchen120 <122383162@qq.com> Date: Fri, 4 Mar 2022 17:05:16 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Helpers/function.php | 75 +- app/Http/Controllers/CategoryController.php | 23 +- public/assets/index/css/style.css | 2235 ++++++++++--------- resources/views/index/index.blade.php | 40 +- 4 files changed, 1253 insertions(+), 1120 deletions(-) diff --git a/app/Helpers/function.php b/app/Helpers/function.php index e656e2e..33b5f2a 100644 --- a/app/Helpers/function.php +++ b/app/Helpers/function.php @@ -20,19 +20,20 @@ function getOneCategory($categoryId, $return = '') /** * Notes: 获取文章分类详情 + * * @Author: 玄尘 * @Date : 2020/9/10 13:21 * @param $categoryId - * @param string $result + * @param string $result * @return \App\Models\Article */ function getOneArticleBYCate($categoryId, $result = '') { $info = Article::where('status', 1) - ->ByCategory($categoryId) - ->latest('sort') - ->latest() - ->first(); + ->ByCategory($categoryId) + ->latest('sort') + ->latest() + ->first(); if ($info) { if ($result) { @@ -49,6 +50,7 @@ function getOneArticleBYCate($categoryId, $result = '') /** * Notes: 获取分类下的文章 + * * @Author: 玄尘 * @Date : 2020/9/10 10:05 * @param $categoryId @@ -59,33 +61,58 @@ function getArticlesBYCate($categoryId, $take = 8, $mark = 'one') { if ($mark == 'one') { $articles = Article::where('status', 1) - ->ByCategory($categoryId) - ->latest('sort') - ->latest() - ->take($take) - ->get(); + ->ByCategory($categoryId) + ->latest('sort') + ->latest() + ->take($take) + ->get(); } else { $cate = Category::find($categoryId); $ids = $cate->getAllChildrenId(); $articles = Article::where('status', 1) - ->ByCategory($ids) - ->latest('sort') - ->latest() - ->take($take) - ->get(); + ->ByCategory($ids) + ->latest('sort') + ->latest() + ->take($take) + ->get(); } return $articles; } +/** + * Notes: 获取带图片的文章 + * + * @Author: 玄尘 + * @Date: 2022/3/4 16:52 + * @param $categoryId + * @param $take + * @return mixed + */ +function getArticlesAndCoverBYCate($categoryId, $take = 8) +{ + $cate = Category::find($categoryId); + $ids = $cate->getAllChildrenId(); + + return Article::where('status', 1) + ->ByCategory($ids) + ->where(function ($query) { + $query->whereNotNull('cover')->orWhere('cover', '<>', ''); + }) + ->latest('sort') + ->latest() + ->take($take) + ->get(); +} + //获取子分类 function getCateChild($categoryId) { return Category::where('status', 1) - ->where('parent_id', $categoryId) - ->orderBy('order', 'asc') - ->get(); + ->where('parent_id', $categoryId) + ->orderBy('order', 'asc') + ->get(); } //获取顶级分类 @@ -104,9 +131,9 @@ function getTopCate($categoryId) function getOneAdvertByCate($categoryId, $result = '') { $info = Advert::where('category_id', $categoryId) - ->latest('sort') - ->latest() - ->first(); + ->latest('sort') + ->latest() + ->first(); if ($info) { if ($result) { return $info->{$result}; @@ -123,8 +150,8 @@ function getOneAdvertByCate($categoryId, $result = '') function getAdvertsByCate($categoryId, $take = 8) { return Advert::where('category_id', $categoryId) - ->latest('sort') - ->latest() - ->take($take)->get(); + ->latest('sort') + ->latest() + ->take($take)->get(); } diff --git a/app/Http/Controllers/CategoryController.php b/app/Http/Controllers/CategoryController.php index faeb19d..0503030 100644 --- a/app/Http/Controllers/CategoryController.php +++ b/app/Http/Controllers/CategoryController.php @@ -3,6 +3,7 @@ namespace App\Http\Controllers; use App\Models\Advert; +use App\Models\Article; use App\Models\Category; class CategoryController extends Controller @@ -10,20 +11,28 @@ class CategoryController extends Controller /** * 显示分类 + * * @param Category $category [description] * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\View\View [type] [description] */ public function index(Category $category) { if ($category->type == Category::TYPE_SHOW && $category->article_id) { - return redirect("articles/" . $category->article_id); + return redirect("articles/".$category->article_id); } else { - $articles = $category->relations(Category::TYPE_ARTICLE) - ->where('status', 1) - ->latest('sort') - ->latest() - ->paginate(); - $parent = $category; +// $articles = $category->relations(Category::TYPE_ARTICLE) +// ->where('status', 1) +// ->latest('sort') +// ->latest() +// ->paginate(); + + $articles = Article::ByCategory($category->getAllChildrenId()) + ->where('status', 1) + ->latest() + ->latest('created_at') + ->paginate(); + + $parent = $category; if ($category->childrens->isEmpty() && $category->parent) { $parent = $category->parent; diff --git a/public/assets/index/css/style.css b/public/assets/index/css/style.css index c036c83..4e364b1 100644 --- a/public/assets/index/css/style.css +++ b/public/assets/index/css/style.css @@ -1,1088 +1,1147 @@ -@charset "utf-8"; -/* CSS Document */ -* { - margin: 0; - padding: 0 -} - -ul li { - list-style: none -} - -img { - border: 0; - max-width: 100% -} - -a { - text-decoration: none; -} - -body { - font-family: "微软雅黑"; - width: 100%; - min-width: 1200px; - color: #333; - font-size: 14px; -} - -p { - text-align: justify -} - -.idxTop-back { - background: url(../images/nys_bg01.jpg) #b2eaf9 no-repeat top center; - width: 100%; - background-size: 100% 100%; -} - -/* - 公告样式 -*/ -.ce-white { - background: #fff; -} - -.contant { - width: 1200px; - margin: 0 auto; -} - -.ce-morgin-tb { - margin: 30px 0; -} - -.ce-img { - position: relative; -} - -.ce-img > span { - position: absolute; - left: 0; - top: 0; - width: 100%; - height: 100%; - background-size: cover; - background-repeat: no-repeat; - background-position: center; -} - -.ce-nowrap { - max-width: 100%; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis -} - -.ce-nowrap-multi { - display: -webkit-box; - overflow: hidden; - text-overflow: ellipsis; - -webkit-box-orient: vertical; - -webkit-line-clamp: 2 -} - -/* - 首页头部 -*/ -.idxTop { - box-sizing: border-box; - position: relative; -} - -.idxLogo { - width: 100%; - cursor: pointer; -} - -.idxNav { - width: 100%; - display: flex; - background-color: #008dd0; -} - -.idxNav li { - padding: 0 50px 0; - color: #fff; - font-size: 15px; - cursor: pointer; - line-height: 50px; - height: 50px; - position: relative; - transition: .2s; -} - -.idxNav li:hover { - color: #fff; -} - -.idxNav li::after { - position: absolute; - content: ''; - left: 50%; - bottom: 0; - background: transparent; - width: 0; - height: 100%; - transition: .2s; -} - -.idxNav li.active::after, .idxNav li:hover::after { - background: #005c88; - width: 100%; - color: #fff; - left: 0%; -} - -.idxNav li span { - position: absolute; - z-index: 9; - width: 100%; - height: 100%; - display: inline-block; - text-align: center; - left: 0; - top: 0; -} - -/* - 首页banenr -*/ -.idxBanner { - width: 100%; - padding-top: 28%; -} - -.idxBanner .swiper-wrapper { - width: 100%; - height: 100%; - position: absolute; - left: 0; - top: 0; -} - -.idxBanner .swiper-slide { - background-size: cover; - background-position: center center; - background-repeat: no-repeat; -} - -.swiper-container-horizontal > .swiper-pagination-bullets, .swiper-pagination-custom, .swiper-pagination-fraction { - bottom: 25px !important; -} - -.idxBanner .swiper-pagination-white .swiper-pagination-bullet { - opacity: 1; -} - -.idxBanner .swiper-pagination-white .swiper-pagination-bullet-active { - background-color: #06acf9; -} - -/* - 首页公告标题 -*/ -.idxTitle { - display: flex; - line-height: 50px; - margin-bottom: 10px; -} - -.idxTitle-name { - font-size: 22px; - flex: 1; - position: relative; - padding-left: 20px; -} - -.idxTitle-name::after { - position: absolute; - background: #06acf9; - content: ''; - left: 0; - top: calc(50% - 11px); - width: 6px; - height: 22px; -} - -.idxTitle-name > span { - font-size: 12px; - padding-left: 6px; - color: #999999; - text-transform: uppercase; -} - -.idxTitle-more { - display: flex; - color: #999999; - cursor: pointer; -} - -.idxTitle-more img { - width: 16px; - height: 16px; - margin: 16px 0 0 10px; -} - - -/* - 首页第一模块 -*/ -.idxOneCont { - display: flex; -} - -.contant-left { - width: 700px; -} - -.oneCont-top { - position: relative; -} - -.oneCont-top-img { - width: 280px; - height: 170px; -} - -.oneCont-top-cont { - position: absolute; - left: 300px; - top: 0; - width: calc(100% - 300px); -} - -.oneCont-top-title { - color: #06acf9; - font-size: 18px; - margin-bottom: 10px; - text-align: center; -} - -.oneCont-top-time { - display: flex; -} - -.oneCont-top-text { - color: #909090; - line-height: 24px; - -webkit-line-clamp: 4; - margin-bottom: 25px; -} - -.oneCont-top-time > span { - flex: 1; - font-size: 13px; - color: #999999; -} - -.oneCont-top-more { - color: #06acf9; - display: flex; - cursor: pointer; -} - -.oneCont-top-more img { - width: 16px; - height: 16px; - margin: 2px 0 0 10px; -} - -.oneCont-ul { - margin-top: 15px; -} - -.oneCont-ul li { - display: flex; - line-height: 36px; -} - -.oneCont-ul p { - flex: 1; - margin-right: 100px; -} - -.oneCont-ul span { - color: #999; -} - -.contant-right { - width: calc(500px - 30px); - margin-left: 30px; -} - -.contant-right-list { - background-color: #f0f0f0; - padding: 12px 20px; - box-sizing: border-box; -} - -.contant-right-list li { - line-height: 44px; - display: flex; -} - -.contant-right-list li:hover, .oneCont-ul li:hover { - color: #06acf9; -} - -.contant-right-list li > p { - flex: 1; - margin-right: 20px; -} - -.contant-right-list li > span { - color: #999; - font-size: 12px; -} - -.oneCont-ul li, .contant-right-list li { - cursor: pointer; - transition: .3s; -} - -/* - 首页第二模块 -*/ -.idxTwo { - background-color: #f0f0f0; - padding: 30px 0 60px; - overflow: hidden; -} - -.idxTwo-list { - overflow: hidden; -} - -.idxTwo-list li { - float: left; - width: 400px; - height: 200px; - text-align: center; - position: relative; - cursor: pointer; -} - -.idxTwo-list-img { - position: absolute; - top: 0; - width: 50%; - height: 200px; -} - -.idxTwo-list-img span { - width: 100%; - height: 100%; - background-size: cover; - display: block; - background-repeat: no-repeat; - background-position: center; -} - -.idxTwo-list-img::after { - border: 10px solid transparent; - width: 0; - height: 0; - position: absolute; - top: calc(50% - 5px); - content: ' ' -} - -.idxTwo-list-cont { - width: 50%; - height: 100%; - padding: 20px; - box-sizing: border-box; - position: absolute; - top: 0; - background-color: #06acf9; - color: #fff; -} - -.idxTwo-list-title { - font-size: 16px; -} - -.idxTwo-list-text { - font-size: 12px; - -webkit-line-clamp: 4; - line-height: 24px; - margin: 10px 0; -} - -.idxTwo-list-time img { - width: 16px; - height: 16px; - margin-left: 10px; - vertical-align: middle; -} - -.idxTwo-list li:nth-child(1) .idxTwo-list-img, .idxTwo-list li:nth-child(1) .idxTwo-list-title, .idxTwo-list li:nth-child(1) .idxTwo-list-time { - display: none; -} - -.idxTwo-list li:nth-child(1) .idxTwo-list-cont { - background-color: #fff; - width: 100%; - color: #000; -} - -.idxTwo-list li:nth-child(1) .idxTwo-list-text { - position: relative; - font-size: 16px; - -webkit-line-clamp: 5; - text-align: left; - padding-top: 15px; - line-height: 26px; -} - -.idxTwo-list li:nth-child(1) .idxTwo-list-text::after { - position: absolute; - content: ''; - left: 0; - top: 0; - background-color: #06acf9; - width: 70px; - height: 4px; -} - -.idxTwo-list li:nth-child(2) .idxTwo-list-img, -.idxTwo-list li:nth-child(3) .idxTwo-list-img { - left: 0; -} - -.idxTwo-list li:nth-child(2) .idxTwo-list-cont, -.idxTwo-list li:nth-child(3) .idxTwo-list-cont { - left: 50%; -} - -.idxTwo-list li:nth-child(2) .idxTwo-list-img::after, -.idxTwo-list li:nth-child(3) .idxTwo-list-img::after { - right: 0; - border-right: 10px solid #06acf9; -} - -.idxTwo-list li:nth-child(4) .idxTwo-list-img, -.idxTwo-list li:nth-child(5) .idxTwo-list-img, -.idxTwo-list li:nth-child(6) .idxTwo-list-img { - right: 0; -} - -.idxTwo-list li:nth-child(4) .idxTwo-list-cont, -.idxTwo-list li:nth-child(5) .idxTwo-list-cont, -.idxTwo-list li:nth-child(6) .idxTwo-list-cont { - right: 50%; -} - -.idxTwo-list li:nth-child(4) .idxTwo-list-img::after, -.idxTwo-list li:nth-child(5) .idxTwo-list-img::after, -.idxTwo-list li:nth-child(6) .idxTwo-list-img::after { - left: 0; - border-left: 10px solid #06acf9; -} - -.newTwo-list { - margin: 0 -.5rem; -} - -.newTwo-list li { - width: calc(25% - 1rem); - margin: 0 .5rem; - float: left; -} - -.newTwo-list-img { - width: 100%; - padding-top: 65%; -} - -.newTwo-list-title { - font-size: 1rem; - margin: .7rem 0 .5rem; -} - -.newTwo-list-text { - color: #999; -} - -/* - 首页第三模块 -*/ -.idxThree .contant { - overflow: hidden; - padding: 10px 0 20px; -} - -.threeCont { - width: calc(50% - 10px); - float: left; - box-shadow: 0 2px 20px rgba(0, 0, 0, .1); - padding: 20px 20px 0; - box-sizing: border-box; -} - -.threeCont:nth-child(1) { - margin-right: 10px; -} - -.threeCont:nth-child(2) { - margin-left: 10px; -} - -.threeCont-top { - position: relative; - margin-bottom: 15px; - cursor: pointer; -} - -.threeCont-top-img { - width: 140px; - height: 90px; -} - -.threeCont-top-cont { - position: absolute; - left: 150px; - top: 0; - width: calc(100% - 150px); -} - -.threeCont-top:hover .threeCont-top-title { - color: #06acf9; -} - -.threeCont-top-title { - font-size: 15px; - margin-bottom: 6px; -} - -.threeCont-top-text { - -webkit-line-clamp: 3; - font-size: 12px; - color: #999; - line-height: 19px; -} - -.threeCont-list li { - display: flex; - position: relative; - padding: 15px 0 15px 14px; - transition: .3s; -} - -.threeCont-list li::after { - position: absolute; - content: ''; - left: 10px; - right: 4px; - top: 0; - width: calc(100% - 14px); - height: 0; - border: 1px dashed #ededed; - transition: .3s; -} - -.threeCont-list li::before { - position: absolute; - content: ''; - left: 0; - top: calc(50% - 3px); - background-color: #e0e0e0; - border-radius: 50%; - width: 6px; - height: 6px; -} - -.threeCont-list li > p { - flex: 1; - margin-right: 60px; -} - -.threeCont-list li > span { - color: #999; - font-size: 13px; -} - -.threeCont-list li:hover { - color: #0599de; - cursor: pointer; -} - -.threeCont-list li:hover::before { - background-color: #0599de; -} - -.idxThree-title { - position: relative; - display: flex; - margin-bottom: 20px; - height: 40px; -} - -.idxThree-title::after { - position: absolute; - content: ''; - display: flex; - background-image: url(../images/title_line.png); - background-repeat: repeat; - background-position: center; - width: 100%; - height: 4px; - left: 0; - bottom: 0; -} - -.idxThree-title-name { - flex: 1; - position: relative; -} - -.idxThree-title-name::after { - position: absolute; - content: ''; - display: flex; - background-image: url(../images/title_back.png); - background-repeat: no-repeat; - background-position: left; - width: 120px; - height: 40px; - left: 0; - bottom: 0; -} - -.idxThree-title-icon { - position: absolute; - width: 120px; - height: 40px; - line-height: 40px; - color: #fff; - padding-left: 6px; - box-sizing: border-box; - z-index: 9; - font-size: 17px; - display: flex; -} - -.idxThree-title-icon img { - width: 18px; - height: 18px; - margin: 12px 8px 0 0; -} - -.idxThree-title-more { - color: #51c5fb; - font-size: 14px; - line-height: 40px; - cursor: pointer; -} - - -/* - 首页第四模块 -*/ -.idxFour { - width: 100%; - background-image: url(../images//idxFour_back.png); - height: 600px; - padding: 30px 0; - background-size: cover; - background-position: center; - background-repeat: no-repeat; -} - -.idxFour .idxTitle, .idxFour .idxTitle-name > span { - color: #fff; -} - -.idxFour .idxTitle-name::after { - background: #fff; -} - -.idxFourSwiper { - padding: 0 20px; - box-sizing: border-box; - position: relative; -} - -.idxFour-slide { - background: #fff; -} - -.idxFour-img { - width: 100%; - padding-top: 80% -} - -.idxFour-cont { - padding: 0 20px 20px; - box-sizing: border-box; -} - -.idxFour-title { - text-align: center; - line-height: 50px; - font-size: 17px; - position: relative; -} - -.idxFour-title::before { - position: absolute; - content: ''; - left: 0; - bottom: 0; - background-color: #e0e0e0; - width: 100%; - height: 1px; -} - -.idxFour-text { - -webkit-line-clamp: 4; - line-height: 24px; - padding-top: 10px; -} - -.idxFour-more { - width: 100px; - text-align: center; - border: 1px solid #000; - background: transparent; - line-height: 34px; - margin: 20px auto 0; -} - -.idxFour-slide:hover { - cursor: pointer; -} - -.idxFour-slide:hover .idxFour-title { - color: #06acf9; -} - -.idxFour-slide:hover .idxFour-more { - background: #06acf9; - border-color: transparent; - color: #fff; -} - -.idxFour-Arrows { - position: absolute; - top: -50px; - right: 20px; - background: #fff; - width: 60px; - height: 30px; - line-height: 40px; - overflow: hidden; - border: 1px solid #fff; -} - -.idxFour-Arrows .swiper-button-disabled { - opacity: 1; -} - -.idxFour-Arrows .swiper-button-next { - right: 0; - background-image: none; - background: #2da9e2; - text-align: center; - width: 50%; - color: #fff; - font-size: 20px; -} - -.idxFour-Arrows .swiper-button-prev { - left: 0; - background-image: none; - text-align: center; - font-size: 20px; - color: #2da9e2; - opacity: 1; -} - -/* - 友情链接 -*/ -.idxLink-ul { - overflow: hidden; - padding: 0 20px; - box-sizing: border-box; -} - -.idxLink-ul li { - float: left; - width: 16.66%; - font-size: 15px; - cursor: pointer; - line-height: 40px; -} - -.idxLink-ul li:hover { - color: #06acf9; -} - -.line { - background: #e6e6e6; - width: 100%; - height: 1px; - margin-top: -15px; - margin-bottom: 10px; - position: relative; -} - -.line::before { - position: absolute; - content: ''; - left: 0; - bottom: 0; - background-color: #06acf9; - width: 12%; - height: 2px; -} - -/* - 尾部 -*/ -.idxFooter { - background: #585858; - color: #fff; - width: 100%; - padding: 40px 0; -} - -.idxFooter-text { - text-align: center; -} - -.idxFooter-text span { - display: block; - font-size: 18px; - line-height: 30px; -} - -.idxFooter-img { - text-align: center; - margin-top: 30px; -} - -.idxFooter-img img { - width: 86px; -} - - -/*详情*/ -.details { - overflow: hidden; -} - -.page-left { - width: 280px; - float: left; - background: #fff; -} - -.page-right { - width: 900px; - float: right; - margin-left: 20px; - margin-top: 20px; -} - -.pagelist h1 { - color: #fff; - height: 45px; - line-height: 45px; - font-size: 18px; - font-weight: 600; - background: #028dcf; - padding-left: 20px; - margin-top: 20px; -} - -.pagelist .listbox { - border: 1px solid #efefef; - margin: 20px 0; -} - -.pagelist li { - border-top: 1px solid #efefef; - border-bottom: 1px solid #efefef; - margin-top: -1px; -} - -.pagelist li a { - height: 35px; - line-height: 35px; - display: block; - background: url(../images/sanjiao2.png) 220px 14px no-repeat #fafafa; - font-size: 14px; - color: #333; - padding-left: 20px; -} - -.pagelist li a:hover, -.pagelist li.active > a { - background: url(../images/sanjiao.png) 218px 14px no-repeat #fafafa; - font-weight: bold; -} - -.pagelujing { - height: 40px; - border-bottom: 2px solid #efefef; - position: relative; - margin-bottom: 14px; -} - -.pagelujing .name { - position: absolute; - left: 0; - top: 0; - height: 40px; - border-bottom: 2px solid #016bd2; - line-height: 40px; - font-size: 16px; - font-weight: bold; -} - -.pagelujing span { - position: absolute; - right: 0; - line-height: 40px; - color: #888; -} - -.pagelujing span a { - color: #313131; -} - -.tcdPageCode { - padding: 15px 20px; - text-align: left; - color: #ccc; - text-align: center; - margin-top: 30px; -} - -.tcdPageCode span.disabled { - display: inline-block; - height: 25px; - line-height: 25px; - padding: 0 10px; - margin: 0 2px; - color: #bfbfbf; - background: #f2f2f2; - border: 1px solid #bfbfbf; - border-radius: 4px; - vertical-align: middle; -} - -.tcdPageCode span.current { - display: inline-block; - height: 25px; - line-height: 25px; - padding: 0 10px; - margin: 0 2px; - color: #fff; - background-color: #428bca; - border: 1px solid #428bca; - border-radius: 4px; - vertical-align: middle; -} - -.tcdPageCode a { - display: inline-block; - color: #428bca; - display: inline-block; - height: 25px; - line-height: 25px; - padding: 0 10px; - border: 1px solid #ddd; - margin: 0 2px; - border-radius: 4px; - vertical-align: middle; -} - -.newslist li { - border-bottom: 1px dotted #dedede; - position: relative; - padding: 0 80px 0 14px; - background: url(../images/jiantou.png) 2px 15px no-repeat; -} - -.newslist li a { - display: block; - height: 36px; - width: 100%; - line-height: 36px; - font-size: 14px; - color: #666; - word-break: break-all; - display: -webkit-box; - -webkit-line-clamp: 1; - -webkit-box-orient: vertical; - overflow: hidden; -} - -.newslist li span { - position: absolute; - right: 0; - top: 0; - line-height: 36px; - color: #bbb; - text-align: center; -} - -.biaoti { - font-size: 18px; - color: #333; - text-align: center; - margin: 0 20px; - font-weight: 600; - margin-top: 30px; -} - -.sshuomign { - color: #888; - font-size: 12px; - line-height: 30px; - text-align: center; -} - -.article_txt { - font-size: 14px; - line-height: 28px; - color: #454545; - margin: 20px 0; - overflow: hidden; -} - -/* 领导班子样式 */ -.leaderslist li { - height: 120px; - position: relative; - padding-left: 120px; - background-size: 100px 100%; - background-repeat: no-repeat; - background-position: left; - margin-top: 10px; -} - -.leaderslist li a { - display: block; - width: 100%; - line-height: 24px; - font-size: 14px; - color: #666; - word-break: break-all; - display: -webkit-box; - -webkit-line-clamp: 1; - -webkit-box-orient: vertical; - overflow: hidden; - display: inline-block; -} - -.leaderslist .name { - padding-bottom: 14px; - /* padding-top: 10px; */ - font-weight: 600px; - font-size: 18px; -} +@charset "utf-8"; +/* CSS Document */ +* { + margin: 0; + padding: 0 +} + +ul li { + list-style: none +} + +img { + border: 0; + max-width: 100% +} + +a { + text-decoration: none; +} + +body { + font-family: "微软雅黑"; + width: 100%; + min-width: 1200px; + color: #333; + font-size: 14px; +} + +p { + text-align: justify +} + +.idxTop-back { + background: url(../images/nys_bg01.png) #fff no-repeat center; + width: 100%; + background-size: cover; +} + +/* + 公告样式 +*/ +.ce-white { + background: #fff; +} + +.contant { + width: 1200px; + margin: 0 auto; +} + +.ce-morgin-tb { + margin: 30px 0; +} + +.ce-img { + position: relative; +} + +.ce-img > span { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + background-size: cover; + background-repeat: no-repeat; + background-position: center; +} + +.ce-nowrap { + max-width: 100%; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis +} + +.ce-nowrap-multi { + display: -webkit-box; + overflow: hidden; + text-overflow: ellipsis; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2 +} + +/* + 首页头部 +*/ +.idxTop { + box-sizing: border-box; + position: relative; + +} + +.idxLogo { + width: 60%; +padding-left:20%; + cursor: pointer; +padding-top:60px; +padding-bottom:80px +} + +.idxNav { + width: 100%; + display: flex; + background-color: #008dd0; +} + +.idxNav li { + padding: 0 50px 0; + color: #fff; + font-size: 15px; + cursor: pointer; + line-height: 50px; + height: 50px; + position: relative; + transition: .2s; +} + +.idxNav li:hover { + color: #fff; +} + +.idxNav li::after { + position: absolute; + content: ''; + left: 50%; + bottom: 0; + background: transparent; + width: 0; + height: 100%; + transition: .2s; +} + +.idxNav li.active::after, .idxNav li:hover::after { + background: #005c88; + width: 100%; + color: #fff; + left: 0%; +} + +.idxNav li span { + position: absolute; + z-index: 9; + width: 100%; + height: 100%; + display: inline-block; + text-align: center; + left: 0; + top: 0; +} + +/* + 首页banenr +*/ +.idxBanner { + width: 100%; + padding-top: 28%; +} + +.idxBanner .swiper-wrapper { + width: 100%; + height: 100%; + position: absolute; + left: 0; + top: 0; +} + +.idxBanner .swiper-slide { + background-size: cover; + background-position: center center; + background-repeat: no-repeat; +} + +.swiper-container-horizontal > .swiper-pagination-bullets, .swiper-pagination-custom, .swiper-pagination-fraction { + bottom: 25px !important; +} + +.idxBanner .swiper-pagination-white .swiper-pagination-bullet { + opacity: 1; +} + +.idxBanner .swiper-pagination-white .swiper-pagination-bullet-active { + background-color: #06acf9; +} + +/* + 首页公告标题 +*/ +.idxTitle { + display: flex; + line-height: 50px; + margin-bottom: 10px; +} + +.idxTitle-name { + font-size: 22px; + flex: 1; + position: relative; + padding-left: 20px; +} + +.idxTitle-name::after { + position: absolute; + background: #06acf9; + content: ''; + left: 0; + top: calc(50% - 11px); + width: 6px; + height: 22px; +} + +.idxTitle-name > span { + font-size: 12px; + padding-left: 6px; + color: #999999; + text-transform: uppercase; +} + +.idxTitle-more { + display: flex; + color: #999999; + cursor: pointer; +} + +.idxTitle-more img { + width: 16px; + height: 16px; + margin: 16px 0 0 10px; +} + + +/* + 首页第一模块 +*/ +.idxOneCont { + display: flex; +} + +.contant-left { + width: 700px; +} + +.oneCont-top { + position: relative; +} + +.oneCont-top-img { + width: 280px; + height: 170px; +} + +.oneCont-top-cont { + position: absolute; + left: 300px; + top: 0; + width: calc(100% - 300px); +} + +.oneCont-top-title { + color: #06acf9; + font-size: 18px; + margin-bottom: 10px; + text-align: center; +} + +.oneCont-top-time { + display: flex; +} + +.oneCont-top-text { + color: #909090; + line-height: 24px; + -webkit-line-clamp: 4; + margin-bottom: 25px; +} + +.oneCont-top-time > span { + flex: 1; + font-size: 13px; + color: #999999; +} + +.oneCont-top-more { + color: #06acf9; + display: flex; + cursor: pointer; +} + +.oneCont-top-more img { + width: 16px; + height: 16px; + margin: 2px 0 0 10px; +} + +.oneCont-ul { + margin-top: 15px; +} + +.oneCont-ul li { + display: flex; + line-height: 36px; +} + +.oneCont-ul p { + flex: 1; + margin-right: 100px; +} + +.oneCont-ul span { + color: #999; +} + +.contant-right { + width: calc(500px - 30px); + margin-left: 30px; +} + +.contant-right-list { + background-color: #f0f0f0; + padding: 12px 20px; + box-sizing: border-box; +} + +.contant-right-list li { + line-height: 44px; + display: flex; +} + +.contant-right-list li:hover, .oneCont-ul li:hover { + color: #06acf9; +} + +.contant-right-list li > p { + flex: 1; + margin-right: 20px; +} + +.contant-right-list li > span { + color: #999; + font-size: 12px; +} + +.oneCont-ul li, .contant-right-list li { + cursor: pointer; + transition: .3s; +} + +/* + 首页第二模块 +*/ +.idxTwo { + background-color: #f0f0f0; + padding: 30px 0 60px; + overflow: hidden; +} + +.idxTwo-list { + overflow: hidden; +} + +.idxTwo-list li { + float: left; + width: 400px; + height: 200px; + text-align: center; + position: relative; + cursor: pointer; +} + +.idxTwo-list-img { + position: absolute; + top: 0; + width: 50%; + height: 200px; +} + +.idxTwo-list-img span { + width: 100%; + height: 100%; + background-size: cover; + display: block; + background-repeat: no-repeat; + background-position: center; +} + +.idxTwo-list-img::after { + border: 10px solid transparent; + width: 0; + height: 0; + position: absolute; + top: calc(50% - 5px); + content: ' ' +} + +.idxTwo-list-cont { + width: 50%; + height: 100%; + padding: 20px; + box-sizing: border-box; + position: absolute; + top: 0; + background-color: #06acf9; + color: #fff; +} + +.idxTwo-list-title { + font-size: 16px; +} + +.idxTwo-list-text { + font-size: 12px; + -webkit-line-clamp: 4; + line-height: 24px; + margin: 10px 0; +} + +.idxTwo-list-time img { + width: 16px; + height: 16px; + margin-left: 10px; + vertical-align: middle; +} + +.idxTwo-list li:nth-child(1) .idxTwo-list-img, .idxTwo-list li:nth-child(1) .idxTwo-list-title, .idxTwo-list li:nth-child(1) .idxTwo-list-time { + display: none; +} + +.idxTwo-list li:nth-child(1) .idxTwo-list-cont { + background-color: #fff; + width: 100%; + color: #000; +} + +.idxTwo-list li:nth-child(1) .idxTwo-list-text { + position: relative; + font-size: 16px; + -webkit-line-clamp: 5; + text-align: left; + padding-top: 15px; + line-height: 26px; +} + +.idxTwo-list li:nth-child(1) .idxTwo-list-text::after { + position: absolute; + content: ''; + left: 0; + top: 0; + background-color: #06acf9; + width: 70px; + height: 4px; +} + +.idxTwo-list li:nth-child(2) .idxTwo-list-img, +.idxTwo-list li:nth-child(3) .idxTwo-list-img { + left: 0; +} + +.idxTwo-list li:nth-child(2) .idxTwo-list-cont, +.idxTwo-list li:nth-child(3) .idxTwo-list-cont { + left: 50%; +} + +.idxTwo-list li:nth-child(2) .idxTwo-list-img::after, +.idxTwo-list li:nth-child(3) .idxTwo-list-img::after { + right: 0; + border-right: 10px solid #06acf9; +} + +.idxTwo-list li:nth-child(4) .idxTwo-list-img, +.idxTwo-list li:nth-child(5) .idxTwo-list-img, +.idxTwo-list li:nth-child(6) .idxTwo-list-img { + right: 0; +} + +.idxTwo-list li:nth-child(4) .idxTwo-list-cont, +.idxTwo-list li:nth-child(5) .idxTwo-list-cont, +.idxTwo-list li:nth-child(6) .idxTwo-list-cont { + right: 50%; +} + +.idxTwo-list li:nth-child(4) .idxTwo-list-img::after, +.idxTwo-list li:nth-child(5) .idxTwo-list-img::after, +.idxTwo-list li:nth-child(6) .idxTwo-list-img::after { + left: 0; + border-left: 10px solid #06acf9; +} + +.newTwo-list { + margin: 0 -.5rem; +} + +.newTwo-list li { + width: calc(16.6% - 1rem); + margin: 0 .5rem; + float: left; +} + +.newTwo-list-img { + width: 100%; + padding-top: 100%; +} + +.newTwo-list-title { + font-size: 1rem; + margin: .7rem 0 .5rem; +} + +.newTwo-list-text { + color: #999; +} + +/* + 首页第三模块 +*/ +.idxThree .contant { + overflow: hidden; + padding: 10px 0 20px; +} + +.threeCont { + width: calc(50% - 10px); + float: left; + box-shadow: 0 2px 20px rgba(0, 0, 0, .1); + padding: 20px 20px 0; + box-sizing: border-box; +} + +.threeCont:nth-child(1) { + margin-right: 10px; +} + +.threeCont:nth-child(2) { + margin-left: 10px; +} + +.threeCont-top { + position: relative; + margin-bottom: 15px; + cursor: pointer; +} + +.threeCont-top-img { + width: 140px; + height: 90px; +} + +.threeCont-top-cont { + position: absolute; + left: 150px; + top: 0; + width: calc(100% - 150px); +} + +.threeCont-top:hover .threeCont-top-title { + color: #06acf9; +} + +.threeCont-top-title { + font-size: 15px; + margin-bottom: 6px; +} + +.threeCont-top-text { + -webkit-line-clamp: 3; + font-size: 12px; + color: #999; + line-height: 19px; +} + +.threeCont-list li { + display: flex; + position: relative; + padding: 15px 0 15px 14px; + transition: .3s; +} + +.threeCont-list li::after { + position: absolute; + content: ''; + left: 10px; + right: 4px; + top: 0; + width: calc(100% - 14px); + height: 0; + border: 1px dashed #ededed; + transition: .3s; +} + +.threeCont-list li::before { + position: absolute; + content: ''; + left: 0; + top: calc(50% - 3px); + background-color: #e0e0e0; + border-radius: 50%; + width: 6px; + height: 6px; +} + +.threeCont-list li > p { + flex: 1; + margin-right: 60px; +} + +.threeCont-list li > span { + color: #999; + font-size: 13px; +} + +.threeCont-list li:hover { + color: #0599de; + cursor: pointer; +} + +.threeCont-list li:hover::before { + background-color: #0599de; +} + +.idxThree-title { + position: relative; + display: flex; + margin-bottom: 20px; + height: 40px; +} + +.idxThree-title::after { + position: absolute; + content: ''; + display: flex; + background-image: url(../images/title_line.png); + background-repeat: repeat; + background-position: center; + width: 100%; + height: 4px; + left: 0; + bottom: 0; +} + +.idxThree-title-name { + flex: 1; + position: relative; +} + +.idxThree-title-name::after { + position: absolute; + content: ''; + display: flex; + background-image: url(../images/title_back.png); + background-repeat: no-repeat; + background-position: left; + width: 120px; + height: 40px; + left: 0; + bottom: 0; +} + +.idxThree-title-icon { + position: absolute; + width: 120px; + height: 40px; + line-height: 40px; + color: #fff; + padding-left: 6px; + box-sizing: border-box; + z-index: 9; + font-size: 17px; + display: flex; +} + +.idxThree-title-icon img { + width: 18px; + height: 18px; + margin: 12px 8px 0 0; +} + +.idxThree-title-more { + color: #51c5fb; + font-size: 14px; + line-height: 40px; + cursor: pointer; +} + + +/* + 首页第四模块 +*/ +.idxFour { + width: 100%; + background-image: url(../images//idxFour_back.png); + height: 600px; + padding: 30px 0; + background-size: cover; + background-position: center; + background-repeat: no-repeat; +} + +.idxFour .idxTitle, .idxFour .idxTitle-name > span { + color: #fff; +} + +.idxFour .idxTitle-name::after { + background: #fff; +} + +.idxFourSwiper { + padding: 0 20px; + box-sizing: border-box; + position: relative; +} + +.idxFour-slide { + background: #fff; +} + +.idxFour-img { + width: 100%; + padding-top: 80% +} + +.idxFour-cont { + padding: 0 20px 20px; + box-sizing: border-box; +} + +.idxFour-title { + text-align: center; + line-height: 50px; + font-size: 17px; + position: relative; +} + +.idxFour-title::before { + position: absolute; + content: ''; + left: 0; + bottom: 0; + background-color: #e0e0e0; + width: 100%; + height: 1px; +} + +.idxFour-text { + -webkit-line-clamp: 4; + line-height: 24px; + padding-top: 10px; +} + +.idxFour-more { + width: 100px; + text-align: center; + border: 1px solid #000; + background: transparent; + line-height: 34px; + margin: 20px auto 0; +} + +.idxFour-slide:hover { + cursor: pointer; +} + +.idxFour-slide:hover .idxFour-title { + color: #06acf9; +} + +.idxFour-slide:hover .idxFour-more { + background: #06acf9; + border-color: transparent; + color: #fff; +} + +.idxFour-Arrows { + position: absolute; + top: -50px; + right: 20px; + background: #fff; + width: 60px; + height: 30px; + line-height: 40px; + overflow: hidden; + border: 1px solid #fff; +} + +.idxFour-Arrows .swiper-button-disabled { + opacity: 1; +} + +.idxFour-Arrows .swiper-button-next { + right: 0; + background-image: none; + background: #2da9e2; + text-align: center; + width: 50%; + color: #fff; + font-size: 20px; +} + +.idxFour-Arrows .swiper-button-prev { + left: 0; + background-image: none; + text-align: center; + font-size: 20px; + color: #2da9e2; + opacity: 1; +} + +/* + 友情链接 +*/ +.idxLink-ul { + overflow: hidden; + padding: 0 20px; + box-sizing: border-box; +} + +.idxLink-ul li { + float: left; + width: 16.66%; + font-size: 15px; + cursor: pointer; + line-height: 40px; +} + +.idxLink-ul li:hover { + color: #06acf9; +} + +.line { + background: #e6e6e6; + width: 100%; + height: 1px; + margin-top: -15px; + margin-bottom: 10px; + position: relative; +} + +.line::before { + position: absolute; + content: ''; + left: 0; + bottom: 0; + background-color: #06acf9; + width: 12%; + height: 2px; +} + +/* + 尾部 +*/ +.idxFooter { + background: #213f88; + color: #fff; + width: 100%; + padding: 40px 0; +} + +.idxFooter-text { + text-align: center; +} + +.idxFooter-text span { + display: block; + font-size: 18px; + line-height: 30px; +} + +.idxFooter-img { + text-align: center; + margin-top: 30px; +} + +.idxFooter-img img { + width: 86px; +} + + +/*详情*/ +.details { + overflow: hidden; +} + +.page-left { + width: 280px; + float: left; + background: #fff; +} + +.page-right { + width: 900px; + float: right; + margin-left: 20px; + margin-top: 20px; +} + +.pagelist h1 { + color: #fff; + height: 45px; + line-height: 45px; + font-size: 18px; + font-weight: 600; + background: #028dcf; + padding-left: 20px; + margin-top: 20px; +} + +.pagelist .listbox { + border: 1px solid #efefef; + margin: 20px 0; +} + +.pagelist li { + border-top: 1px solid #efefef; + border-bottom: 1px solid #efefef; + margin-top: -1px; +} + +.pagelist li a { + height: 35px; + line-height: 35px; + display: block; + background: url(../images/sanjiao2.png) 220px 14px no-repeat #fafafa; + font-size: 14px; + color: #333; + padding-left: 20px; +} + +.pagelist li a:hover, +.pagelist li.active > a { + background: url(../images/sanjiao.png) 218px 14px no-repeat #fafafa; + font-weight: bold; +} + +.pagelujing { + height: 40px; + border-bottom: 2px solid #efefef; + position: relative; + margin-bottom: 14px; +} + +.pagelujing .name { + position: absolute; + left: 0; + top: 0; + height: 40px; + border-bottom: 2px solid #016bd2; + line-height: 40px; + font-size: 16px; + font-weight: bold; +} + +.pagelujing span { + position: absolute; + right: 0; + line-height: 40px; + color: #888; +} + +.pagelujing span a { + color: #313131; +} + +.tcdPageCode { + padding: 15px 20px; + text-align: left; + color: #ccc; + text-align: center; + margin-top: 30px; +} + +.tcdPageCode span.disabled { + display: inline-block; + height: 25px; + line-height: 25px; + padding: 0 10px; + margin: 0 2px; + color: #bfbfbf; + background: #f2f2f2; + border: 1px solid #bfbfbf; + border-radius: 4px; + vertical-align: middle; +} + +.tcdPageCode span.current { + display: inline-block; + height: 25px; + line-height: 25px; + padding: 0 10px; + margin: 0 2px; + color: #fff; + background-color: #428bca; + border: 1px solid #428bca; + border-radius: 4px; + vertical-align: middle; +} + +.tcdPageCode a { + display: inline-block; + color: #428bca; + display: inline-block; + height: 25px; + line-height: 25px; + padding: 0 10px; + border: 1px solid #ddd; + margin: 0 2px; + border-radius: 4px; + vertical-align: middle; +} + +.newslist li { + border-bottom: 1px dotted #dedede; + position: relative; + padding: 0 80px 0 14px; + background: url(../images/jiantou.png) 2px 15px no-repeat; +} + +.newslist li a { + display: block; + height: 36px; + width: 100%; + line-height: 36px; + font-size: 14px; + color: #666; + word-break: break-all; + display: -webkit-box; + -webkit-line-clamp: 1; + -webkit-box-orient: vertical; + overflow: hidden; +} + +.newslist li span { + position: absolute; + right: 0; + top: 0; + line-height: 36px; + color: #bbb; + text-align: center; +} + +.biaoti { + font-size: 18px; + color: #333; + text-align: center; + margin: 0 20px; + font-weight: 600; + margin-top: 30px; +} + +.sshuomign { + color: #888; + font-size: 12px; + line-height: 30px; + text-align: center; +} + +.article_txt { + font-size: 14px; + line-height: 28px; + color: #454545; + margin: 20px 0; + overflow: hidden; +} + +/* 领导班子样式 */ +.leaderslist li { + height: 120px; + position: relative; + padding-left: 120px; + background-size: 100px 100%; + background-repeat: no-repeat; + background-position: left; + margin-top: 10px; +} + +.leaderslist li a { + display: block; + width: 100%; + line-height: 24px; + font-size: 14px; + color: #666; + word-break: break-all; + display: -webkit-box; + -webkit-line-clamp: 1; + -webkit-box-orient: vertical; + overflow: hidden; + display: inline-block; +} + +.leaderslist .name { + padding-bottom: 14px; + /* padding-top: 10px; */ + font-weight: 600px; + font-size: 18px; +} + +.flexrow{ +display: -webkit-box; /* 老版本语法: Safari, iOS, Android browser, older WebKit browsers. */ + display: -moz-box; /* 老版本语法: Firefox (buggy) */ + display: -ms-flexbox; /* 混合版本语法: IE 10 */ + display: -webkit-flex; /* 新版本语法: Chrome 21+ */ + display: flex; /* 新版本语法: Opera 12.1, Firefox 22+ */ + +-webkit-box-orient: vertical; + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + + -webkit-box-align: center; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + +-webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; +} + +.jc_sb{ + + -webkit-box-pack: justify; + -webkit-justify-content: space-between; + -ms-flex-pack: justify; + justify-content: space-between; +} + + +.idxFooter-text a{ +display:block; +color:#fff; +font-size:18px; +text-align:left; +padding-bottom:10px +} + +.banner_3{ + margin-bottom:10px; +} + +.swiper-pagination-dian{ + text-align:right; + right:10px !important; +width:calc( 100% - 10px ) !important; + +} + +.swiper-pagination-dian .swiper-pagination-bullet-active{ +background:#fff !important; +} \ No newline at end of file diff --git a/resources/views/index/index.blade.php b/resources/views/index/index.blade.php index 433e73d..70837df 100644 --- a/resources/views/index/index.blade.php +++ b/resources/views/index/index.blade.php @@ -71,6 +71,25 @@ + +
+ + + + + @if (getArticlesBYCate(24,4)->isNotEmpty()) @@ -85,7 +104,7 @@